aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsapier <Sapier at GMX dot net>2014-06-15 21:30:44 +0200
committersapier <Sapier at GMX dot net>2014-06-26 20:57:17 +0200
commit13517fb726bd60dceae4fc414d93e5dc9d9daef8 (patch)
tree6767773c0c351ff5da47fcc2dcb2d286f74e3414
parent24face5249abfddd3de1e255ec4072677b39969d (diff)
downloadminetest-13517fb726bd60dceae4fc414d93e5dc9d9daef8.tar.gz
minetest-13517fb726bd60dceae4fc414d93e5dc9d9daef8.tar.bz2
minetest-13517fb726bd60dceae4fc414d93e5dc9d9daef8.zip
Add separate download timeout to allow download of bigger files or on low bandwidth lines
-rw-r--r--minetest.conf.example2
-rw-r--r--src/defaultsettings.cpp1
-rw-r--r--src/guiEngine.cpp1
3 files changed, 4 insertions, 0 deletions
diff --git a/minetest.conf.example b/minetest.conf.example
index a8d573d82..5c4be79f3 100644
--- a/minetest.conf.example
+++ b/minetest.conf.example
@@ -212,6 +212,8 @@
# - 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
diff --git a/src/defaultsettings.cpp b/src/defaultsettings.cpp
index cc6a0dd69..cf9101e34 100644
--- a/src/defaultsettings.cpp
+++ b/src/defaultsettings.cpp
@@ -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");
diff --git a/src/guiEngine.cpp b/src/guiEngine.cpp
index 34bdaffad..530733216 100644
--- a/src/guiEngine.cpp
+++ b/src/guiEngine.cpp
@@ -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) {