summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2020-12-22 09:54:06 +0100
committerDaniel Stenberg <daniel@haxx.se>2020-12-22 09:56:31 +0100
commitd266e71c6b53114950eab71ce5bbba15a085001c (patch)
treea6f900344051e2aa51a2fe730ea64b71a2447868
parenta0962a6417f17f27fb197ae237cc65811627d7c5 (diff)
downloadcurl-bagder/paused-speedcheck.tar.gz
speedcheck: exclude paused transfersbagder/paused-speedcheck
Paused transfers should not be stopped due to slow speed even when CURLOPT_LOW_SPEED_LIMIT is set. Additionally, the slow speed timer is now reset when the transfer is unpaused - as otherwise it would easily just trigger immediately after unpausing. Reported-by: Harry Sintonen Fixes #6358
-rw-r--r--lib/easy.c3
-rw-r--r--lib/speedcheck.c4
2 files changed, 7 insertions, 0 deletions
diff --git a/lib/easy.c b/lib/easy.c
index dc790b01d..311946bdf 100644
--- a/lib/easy.c
+++ b/lib/easy.c
@@ -1080,6 +1080,9 @@ CURLcode curl_easy_pause(struct Curl_easy *data, int action)
(KEEP_RECV_PAUSE|KEEP_SEND_PAUSE)) {
Curl_expire(data, 0, EXPIRE_RUN_NOW); /* get this handle going again */
+ /* reset the too-slow time keeper */
+ data->state.keeps_speed.tv_sec = 0;
+
if(!data->state.tempcount)
/* if not pausing again, force a recv/send check of this connection as
the data might've been read off the socket already */
diff --git a/lib/speedcheck.c b/lib/speedcheck.c
index 2665a44c5..841d256b4 100644
--- a/lib/speedcheck.c
+++ b/lib/speedcheck.c
@@ -39,6 +39,10 @@ void Curl_speedinit(struct Curl_easy *data)
CURLcode Curl_speedcheck(struct Curl_easy *data,
struct curltime now)
{
+ if(data->req.keepon & KEEP_RECV_PAUSE)
+ /* A paused transfer is not qualified for speed checks */
+ return CURLE_OK;
+
if((data->progress.current_speed >= 0) && data->set.low_speed_time) {
if(data->progress.current_speed < data->set.low_speed_limit) {
if(!data->state.keeps_speed.tv_sec)