add EAGAIN check on write to nonblock sock

This commit is contained in:
11soda11 2026-07-29 01:08:00 +02:00
parent 7f0458823d
commit 5635e6b94d

View file

@ -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;
}