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:
Dave Reisner 2011-05-26 19:32:45 -04:00 committed by Dan McGee
parent 8f1c873b5f
commit 8807cac100
1 changed files with 2 additions and 0 deletions

View File

@ -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) {