mirror of
https://github.com/moparisthebest/pacman
synced 2024-12-23 00:08:50 -05:00
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>
This commit is contained in:
parent
8f1c873b5f
commit
8807cac100
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user