If a connection drops below 10kb/s for 10s, curl will kill the transfer
and we'll report failure.

Signed-off-by: Dave Reisner <[email protected]>
---
 lib/libalpm/dload.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/lib/libalpm/dload.c b/lib/libalpm/dload.c
index d024c73..3d90130 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, 10240L);
+       curl_easy_setopt(handle->curl, CURLOPT_LOW_SPEED_TIME, 10L);
 
        useragent = getenv("HTTP_USER_AGENT");
        if(useragent != NULL) {
-- 
1.7.5.2


Reply via email to