about summary refs log tree commit diff
path: root/src/libstore/download.cc
diff options
context:
space:
mode:
authorGraham Christensen <graham@grahamc.com>2019-08-07T19·14-0400
committerGraham Christensen <graham@grahamc.com>2019-08-08T14·22-0400
commita02457db715a80de7630d823fd8d7230a4bd451f (patch)
treebbca88be36bf7216f032cb56440ca73f753faae7 /src/libstore/download.cc
parent1eeaf99cf89630f84b4a1b6882a0f98019725d9e (diff)
conf: stalled-download-timeout: make tunable
Make curl's low speed limit configurable via stalled-download-timeout.
Before, this limit was five minutes without receiving a single byte.
This is much too long as if the remote end may not have even
acknowledged the HTTP request.
Diffstat (limited to 'src/libstore/download.cc')
-rw-r--r--src/libstore/download.cc4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/libstore/download.cc b/src/libstore/download.cc
index 91087eebcf..c322d267d4 100644
--- a/src/libstore/download.cc
+++ b/src/libstore/download.cc
@@ -236,8 +236,6 @@ struct CurlDownloader : public Downloader
             return ((DownloadItem *) userp)->readCallback(buffer, size, nitems);
         }
 
-        long lowSpeedTimeout = 300;
-
         void init()
         {
             if (!req) req = curl_easy_init();
@@ -297,7 +295,7 @@ struct CurlDownloader : public Downloader
             curl_easy_setopt(req, CURLOPT_CONNECTTIMEOUT, downloadSettings.connectTimeout.get());
 
             curl_easy_setopt(req, CURLOPT_LOW_SPEED_LIMIT, 1L);
-            curl_easy_setopt(req, CURLOPT_LOW_SPEED_TIME, lowSpeedTimeout);
+            curl_easy_setopt(req, CURLOPT_LOW_SPEED_TIME, downloadSettings.stalledDownloadTimeout.get());
 
             /* If no file exist in the specified path, curl continues to work
                anyway as if netrc support was disabled. */