]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
pause: force a connection (re-)check after unpausing
authorDaniel Stenberg <daniel@haxx.se>
Fri, 6 Mar 2020 09:04:28 +0000 (10:04 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Sat, 7 Mar 2020 09:49:51 +0000 (10:49 +0100)
There might be data available that was already read off the socket, for
example in the TLS layer.

Reported-by: Anders Berg
Fixes #4966
Closes #5049

lib/easy.c

index 33bc1aab796d67dc84ca1090cceae3a8cfe10c6b..f7a6d5c6044aea9a4abd4013d15e975db61174e8 100644 (file)
@@ -1047,6 +1047,10 @@ CURLcode curl_easy_pause(struct Curl_easy *data, int action)
   if((newstate & (KEEP_RECV_PAUSE|KEEP_SEND_PAUSE)) !=
      (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->multi)
       Curl_update_timer(data->multi);
   }