Add separate download timeout to allow download of bigger files or on low bandwidth...
authorsapier <Sapier at GMX dot net>
Sun, 15 Jun 2014 19:30:44 +0000 (21:30 +0200)
committersapier <Sapier at GMX dot net>
Thu, 26 Jun 2014 18:57:17 +0000 (20:57 +0200)
minetest.conf.example
src/defaultsettings.cpp
src/guiEngine.cpp

index a8d573d82d6e3295331badd20191c6da57ff0fce..5c4be79f380a47205ed543e4aa52ddebe2e44877 100644 (file)
 # - Downloads performed by main menu (e.g. mod manager)
 # Only has an effect if compiled with cURL
 #curl_parallel_limit = 8
+# maximum time in ms a file download (e.g. a mod download) may take
+#curl_file_download_timeout = 300000
 
 # enable usage of remote media server (if provided by server)
 #enable_remote_media_server = true
index cc6a0dd69164f91d9de422bac43afe4b6ec7076a..cf9101e34c8ecfa02d14d2e859be078e9482e557 100644 (file)
@@ -153,6 +153,7 @@ void set_default_settings(Settings *settings)
 
        settings->setDefault("curl_timeout", "5000");
        settings->setDefault("curl_parallel_limit", "8");
+       settings->setDefault("curl_file_download_timeout", "300000");
 
        settings->setDefault("enable_remote_media_server", "true");
 
index 34bdaffad23ee6e6e6a2723a9bf5a8c4c45b50fb..5307332164bef4a4e62c9781d22b6c121abc7482 100644 (file)
@@ -523,6 +523,7 @@ bool GUIEngine::downloadFile(std::string url,std::string target)
        HTTPFetchResult fetchresult;
        fetchrequest.url = url;
        fetchrequest.caller = HTTPFETCH_SYNC;
+       fetchrequest.timeout = g_settings->getS32("curl_file_download_timeout");
        httpfetch_sync(fetchrequest, fetchresult);
 
        if (fetchresult.succeeded) {