]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
pause: only trigger a reread if the unpause sticks
authorDaniel Stenberg <daniel@haxx.se>
Fri, 25 Sep 2020 07:45:35 +0000 (09:45 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Fri, 25 Sep 2020 13:18:10 +0000 (15:18 +0200)
As an unpause might itself get paused again and then triggering another
reread doesn't help.

Follow-up from e040146f22608fd9 (shipped since 7.69.1)

Bug: https://curl.haxx.se/mail/lib-2020-09/0081.html
Patch-by: Kunal Chandarana
Fixes #5988
Closes #6013

lib/easy.c

index 453859d4418029393d52465ffdf7a2d26061174b..60e2befd764cdf8cdc726ae8199b82df6c8853d7 100644 (file)
@@ -1067,9 +1067,10 @@ 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 */
 
-    /* force a recv/send check of this connection, as the data might've been
-       read off the socket already */
-    data->conn->cselect_bits = CURL_CSELECT_IN | CURL_CSELECT_OUT;
+    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 */
+      data->conn->cselect_bits = CURL_CSELECT_IN | CURL_CSELECT_OUT;
     if(data->multi)
       Curl_update_timer(data->multi);
   }