From 5a898d373eb5aeeaed06db77c061fc7c42da8a02 Mon Sep 17 00:00:00 2001 From: Ben Kibbey Date: Tue, 5 Oct 2010 12:06:49 -0700 Subject: [PATCH] Abort curl transfers if they drop below 1000B/s for more than 60s. Signed-off-by: Brenden Matthews --- src/ccurl_thread.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/ccurl_thread.cc b/src/ccurl_thread.cc index 53c2d403..a8fe47a6 100644 --- a/src/ccurl_thread.cc +++ b/src/ccurl_thread.cc @@ -114,6 +114,8 @@ void ccurl_fetch_data(thread_handle &handle, const ccurl_location_ptr &curloc) curl_easy_setopt(curl, CURLOPT_WRITEDATA, (void *) &chunk); curl_easy_setopt(curl, CURLOPT_USERAGENT, "conky-curl/1.0"); curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1); + curl_easy_setopt(curl, CURLOPT_LOW_SPEED_LIMIT, 1000); + curl_easy_setopt(curl, CURLOPT_LOW_SPEED_TIME, 60); res = curl_easy_perform(curl); if (res == CURLE_OK && chunk.size) {