Skip to content

Commit 13517fb

Browse files
sapiersapier
sapier
authored and
sapier
committedJun 26, 2014
Add separate download timeout to allow download of bigger files or on low bandwidth lines
1 parent 24face5 commit 13517fb

File tree

3 files changed

+4
-0
lines changed

3 files changed

+4
-0
lines changed
 

‎minetest.conf.example

+2
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,8 @@
212212
# - Downloads performed by main menu (e.g. mod manager)
213213
# Only has an effect if compiled with cURL
214214
#curl_parallel_limit = 8
215+
# maximum time in ms a file download (e.g. a mod download) may take
216+
#curl_file_download_timeout = 300000
215217

216218
# enable usage of remote media server (if provided by server)
217219
#enable_remote_media_server = true

‎src/defaultsettings.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ void set_default_settings(Settings *settings)
153153

154154
settings->setDefault("curl_timeout", "5000");
155155
settings->setDefault("curl_parallel_limit", "8");
156+
settings->setDefault("curl_file_download_timeout", "300000");
156157

157158
settings->setDefault("enable_remote_media_server", "true");
158159

‎src/guiEngine.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -523,6 +523,7 @@ bool GUIEngine::downloadFile(std::string url,std::string target)
523523
HTTPFetchResult fetchresult;
524524
fetchrequest.url = url;
525525
fetchrequest.caller = HTTPFETCH_SYNC;
526+
fetchrequest.timeout = g_settings->getS32("curl_file_download_timeout");
526527
httpfetch_sync(fetchrequest, fetchresult);
527528

528529
if (fetchresult.succeeded) {

0 commit comments

Comments
 (0)
Please sign in to comment.