From 5635e6b94de7f8ee7c2a1883139ea9f0678d8362 Mon Sep 17 00:00:00 2001 From: 11soda11 <115734183+Sodastream11@users.noreply.github.com> Date: Wed, 29 Jul 2026 01:08:00 +0200 Subject: [PATCH] add EAGAIN check on write to nonblock sock --- src/tool_doswin.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/tool_doswin.c b/src/tool_doswin.c index d218e0dd83..b8a94ebc4d 100644 --- a/src/tool_doswin.c +++ b/src/tool_doswin.c @@ -759,6 +759,7 @@ static int swrite_blocking_on_nonblock(curl_socket_t nonblock_sock, FD_ZERO(&fdwrite); FD_ZERO(&fdexcep); + FD_SET(nonblock_sock, &fdwrite); do { @@ -783,6 +784,9 @@ static int swrite_blocking_on_nonblock(curl_socket_t nonblock_sock, ret = swrite(nonblock_sock, data + nwritten, nbytes - nwritten); if(ret <= 0) { + if(SOCK_EAGAIN(SOCKERRNO)) + continue; + errorf("socket write error: %d", SOCKERRNO); return -1; }