From b261389dbad6d96c193f6885b216e358905b3ecc Mon Sep 17 00:00:00 2001 From: Paul Seligman Date: Fri, 7 Oct 2022 07:52:31 -0400 Subject: ws: minor fixes for web sockets without the CONNECT_ONLY flag - Fixed an issue where is_in_callback was getting cleared when using web sockets with debug logging enabled - Ensure the handle is is_in_callback when calling out to fwrite_func - Change the write vs. send_data decision to whether or not the handle is in CONNECT_ONLY mode. - Account for buflen not including the header length in curl_ws_send Closes #9665 --- lib/sendf.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib/sendf.c') diff --git a/lib/sendf.c b/lib/sendf.c index 66cec0597..d26b7e7cd 100644 --- a/lib/sendf.c +++ b/lib/sendf.c @@ -735,9 +735,10 @@ void Curl_debug(struct Curl_easy *data, curl_infotype type, static const char s_infotype[CURLINFO_END][3] = { "* ", "< ", "> ", "{ ", "} ", "{ ", "} " }; if(data->set.fdebug) { + bool inCallback = Curl_is_in_callback(data); Curl_set_in_callback(data, true); (void)(*data->set.fdebug)(data, type, ptr, size, data->set.debugdata); - Curl_set_in_callback(data, false); + Curl_set_in_callback(data, inCallback); } else { switch(type) { -- cgit v1.2.1