]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
ws: handle blocked sends better
authorz2_ <88509734+z2-2z@users.noreply.github.com>
Sat, 31 May 2025 12:22:00 +0000 (14:22 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Sat, 31 May 2025 15:04:18 +0000 (17:04 +0200)
Closes #17496

lib/ws.c

index 93ec3a785ad9a67f7fc172c94e96a09ac534014f..61ab5019fd811f77bfe6c6f08940e7cb0700a8d9 100644 (file)
--- a/lib/ws.c
+++ b/lib/ws.c
@@ -1384,6 +1384,10 @@ CURL_EXTERN CURLcode curl_ws_send(CURL *d, const void *buffer_arg,
       if(n < 0 && (result != CURLE_AGAIN))
         goto out;
       ws->sendbuf_payload += Curl_bufq_len(&ws->sendbuf) - prev_len;
+      if(!ws->sendbuf_payload) {
+        result = CURLE_AGAIN;
+        goto out;
+      }
     }
 
     /* flush, blocking when in callback */