Still needs testing, but "worked" in Linux.
This commit is contained in:
parent
c8d58798f0
commit
51fcb5a7bd
1 changed files with 3 additions and 2 deletions
|
@ -84,8 +84,9 @@ int sock_connect(p_sock ps, SA *addr, socklen_t addr_len, int timeout)
|
||||||
if (err > 0) {
|
if (err > 0) {
|
||||||
char dummy;
|
char dummy;
|
||||||
/* try reading so that errno is set */
|
/* try reading so that errno is set */
|
||||||
if (recv(sock, &dummy, 0, 0) < 0) return IO_ERROR;
|
if (recv(sock, &dummy, 0, 0) < 0 && errno != EAGAIN)
|
||||||
return IO_DONE;
|
return IO_ERROR;
|
||||||
|
else return IO_DONE;
|
||||||
/* if no event happened, there was a timeout */
|
/* if no event happened, there was a timeout */
|
||||||
} else return IO_TIMEOUT;
|
} else return IO_TIMEOUT;
|
||||||
/* otherwise connection succeeded */
|
/* otherwise connection succeeded */
|
||||||
|
|
Loading…
Add table
Reference in a new issue