mirror of
https://github.com/curl/curl.git
synced 2026-08-01 17:20:30 +03:00
add EAGAIN check on write to nonblock sock
This commit is contained in:
parent
7f0458823d
commit
5635e6b94d
1 changed files with 4 additions and 0 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue