]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
speedlimit: also reset on send unpausing
authorStefan Eissing <stefan@eissing.org>
Tue, 25 Nov 2025 08:30:34 +0000 (09:30 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Tue, 25 Nov 2025 10:01:37 +0000 (11:01 +0100)
The low speedlimit currently counts both up- and download speed
accumulated. So, when unpausing upload, also reset the counter.

Closes #19687

lib/progress.c
lib/progress.h
lib/transfer.c

index 59c5b9a00f280a69e9a1df22a900c95ccf00d7bc..7124a307d1f5fed0d41ba32de7c31586d20e9c30 100644 (file)
@@ -196,6 +196,14 @@ void Curl_pgrsRecvPause(struct Curl_easy *data, bool enable)
   }
 }
 
+void Curl_pgrsSendPause(struct Curl_easy *data, bool enable)
+{
+  if(!enable) {
+    data->progress.speeder_c = 0; /* reset speed records */
+    pgrs_speedinit(data); /* reset low speed measurements */
+  }
+}
+
 /*
  *
  * Curl_pgrsTimeWas(). Store the timestamp time at the given label.
index 96a26fe1a4d9f30643fa83b8cdafef7f3c68c415..5535c69cbff5f6f58259cee52d665d8a85b41f99 100644 (file)
@@ -59,8 +59,9 @@ void Curl_pgrsUpdate_nometer(struct Curl_easy *data);
 /* perform progress update with callbacks and speed checks */
 CURLcode Curl_pgrsCheck(struct Curl_easy *data);
 
-/* Inform progress/speedcheck about receive pausing */
+/* Inform progress/speedcheck about receive/send pausing */
 void Curl_pgrsRecvPause(struct Curl_easy *data, bool enable);
+void Curl_pgrsSendPause(struct Curl_easy *data, bool enable);
 
 /* Reset sizes and couners for up- and download. */
 void Curl_pgrsReset(struct Curl_easy *data);
index fbacdf4290619075aa1c179fc657469f39fa790d..04a013361ebd45ac54bf5faef9d093acdff5baea 100644 (file)
@@ -925,6 +925,7 @@ CURLcode Curl_xfer_pause_send(struct Curl_easy *data, bool enable)
   Curl_rlimit_block(&data->progress.ul.rlimit, enable, curlx_now());
   if(!enable && Curl_creader_is_paused(data))
     result = Curl_creader_unpause(data);
+  Curl_pgrsSendPause(data, enable);
   return result;
 }