summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorDave Reisner <d@falconindy.com>2011-05-27 01:32:45 +0200
committerDan McGee <dan@archlinux.org>2011-06-01 22:05:30 +0200
commit8807cac100acb2d368232833b2478e96a1806fa9 (patch)
treefa3d0c6cc1215de8ec316674f79f3dcf5301b041 /lib
parent8f1c873b5f07f42a8bdc65bb03097790135a9c94 (diff)
downloadpacman-8807cac100acb2d368232833b2478e96a1806fa9.tar.gz
pacman-8807cac100acb2d368232833b2478e96a1806fa9.tar.xz
dload: abort transfer on CURLOPT_LOW_SPEED_LIMIT
If a connection drops below 1kb/s for 10s, curl will kill the transfer and we'll report failure. This is the average transfer speed over the delta defined by CURLOPT_LOW_SPEED_TIME, so setting a low value here shouldn't bother folks using 14.4k dial-up. Signed-off-by: Dave Reisner <d@falconindy.com> Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/libalpm/dload.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/libalpm/dload.c b/lib/libalpm/dload.c
index d024c736..e29929ef 100644
--- a/lib/libalpm/dload.c
+++ b/lib/libalpm/dload.c
@@ -194,6 +194,8 @@ static int curl_download_internal(const char *url, const char *localpath,
curl_easy_setopt(handle->curl, CURLOPT_FOLLOWLOCATION, 1L);
curl_easy_setopt(handle->curl, CURLOPT_PROGRESSFUNCTION, curl_progress);
curl_easy_setopt(handle->curl, CURLOPT_PROGRESSDATA, (void *)&dlfile);
+ curl_easy_setopt(handle->curl, CURLOPT_LOW_SPEED_LIMIT, 1200L);
+ curl_easy_setopt(handle->curl, CURLOPT_LOW_SPEED_TIME, 10L);
useragent = getenv("HTTP_USER_AGENT");
if(useragent != NULL) {