mirror of
https://github.com/curl/curl.git
synced 2026-08-25 02:33:31 +03:00
socks: make the connect phase non-blocking
Removes two entries from KNOWN_BUGS. Closes #4907
This commit is contained in:
parent
d60b1b37a1
commit
4a4b63daaa
13 changed files with 830 additions and 566 deletions
11
lib/sendf.c
11
lib/sendf.c
|
|
@ -692,19 +692,20 @@ CURLcode Curl_read_plain(curl_socket_t sockfd,
|
|||
ssize_t nread = sread(sockfd, buf, bytesfromsocket);
|
||||
|
||||
if(-1 == nread) {
|
||||
int err = SOCKERRNO;
|
||||
int return_error;
|
||||
const int err = SOCKERRNO;
|
||||
const bool return_error =
|
||||
#ifdef USE_WINSOCK
|
||||
return_error = WSAEWOULDBLOCK == err;
|
||||
WSAEWOULDBLOCK == err
|
||||
#else
|
||||
return_error = EWOULDBLOCK == err || EAGAIN == err || EINTR == err;
|
||||
EWOULDBLOCK == err || EAGAIN == err || EINTR == err
|
||||
#endif
|
||||
;
|
||||
*n = 0; /* no data returned */
|
||||
if(return_error)
|
||||
return CURLE_AGAIN;
|
||||
return CURLE_RECV_ERROR;
|
||||
}
|
||||
|
||||
/* we only return number of bytes read when we return OK */
|
||||
*n = nread;
|
||||
return CURLE_OK;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue