aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2023-10-08 10:39:39 +0200
committerDaniel Stenberg <daniel@haxx.se>2023-10-09 08:21:51 +0200
commitdc4e885f35afed10f941cd7e3090f5d5904078cf (patch)
treefb2d2ac601d8bde1d08fd93d114ef78b750155c7
parent0e4bef0862cb6dfb7693b9b67a6835cf85e23e4e (diff)
downloadcurl-dc4e885f35afed10f941cd7e3090f5d5904078cf.tar.gz
curl_easy_pause: set "in callback" true on exit if true
Because it might have called another callback in the mean time that then set the bit FALSE on exit. Reported-by: Jay Satiro Fixes #12059 Closes #12061
-rw-r--r--lib/easy.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/easy.c b/lib/easy.c
index e0bde371f..6b4fb8efe 100644
--- a/lib/easy.c
+++ b/lib/easy.c
@@ -1083,11 +1083,14 @@ CURLcode curl_easy_pause(struct Curl_easy *data, int action)
CURLcode result = CURLE_OK;
int oldstate;
int newstate;
+ bool recursive = FALSE;
if(!GOOD_EASY_HANDLE(data) || !data->conn)
/* crazy input, don't continue */
return CURLE_BAD_FUNCTION_ARGUMENT;
+ if(Curl_is_in_callback(data))
+ recursive = TRUE;
k = &data->req;
oldstate = k->keepon & (KEEP_RECV_PAUSE| KEEP_SEND_PAUSE);
@@ -1154,6 +1157,11 @@ CURLcode curl_easy_pause(struct Curl_easy *data, int action)
corresponding socket callback, if used */
result = Curl_updatesocket(data);
+ if(recursive)
+ /* this might have called a callback recursively which might have set this
+ to false again on exit */
+ Curl_set_in_callback(data, TRUE);
+
return result;
}