1
0
mirror of https://github.com/moparisthebest/curl synced 2024-11-17 15:05:02 -05:00

pause: force a connection (re-)check after unpausing

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
This commit is contained in:
Daniel Stenberg 2020-03-06 10:04:28 +01:00
parent 4b786abc43
commit e040146f22
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2

View File

@ -1047,6 +1047,10 @@ CURLcode curl_easy_pause(struct Curl_easy *data, int action)
if((newstate & (KEEP_RECV_PAUSE|KEEP_SEND_PAUSE)) != if((newstate & (KEEP_RECV_PAUSE|KEEP_SEND_PAUSE)) !=
(KEEP_RECV_PAUSE|KEEP_SEND_PAUSE)) { (KEEP_RECV_PAUSE|KEEP_SEND_PAUSE)) {
Curl_expire(data, 0, EXPIRE_RUN_NOW); /* get this handle going again */ 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) if(data->multi)
Curl_update_timer(data->multi); Curl_update_timer(data->multi);
} }