mirror of
https://github.com/3proxy/3proxy.git
synced 2025-04-19 10:42:10 +08:00
Update common.c
Process failed connect more correcly
This commit is contained in:
parent
266e62644c
commit
7e681bbacd
@ -377,10 +377,11 @@ int connectwithpoll(SOCKET sock, struct sockaddr *sa, SASIZETYPE size, int to){
|
|||||||
if(so._connect(sock,sa,size)) {
|
if(so._connect(sock,sa,size)) {
|
||||||
if(errno != EAGAIN && errno != EINPROGRESS) return (13);
|
if(errno != EAGAIN && errno != EINPROGRESS) return (13);
|
||||||
}
|
}
|
||||||
|
if(!errno) return 0;
|
||||||
memset(fds, 0, sizeof(fds));
|
memset(fds, 0, sizeof(fds));
|
||||||
fds[0].fd = sock;
|
fds[0].fd = sock;
|
||||||
fds[0].events = POLLOUT;
|
fds[0].events = POLLOUT|POLLIN;
|
||||||
if(so._poll(fds, 1, to*1000) <= 0) {
|
if(so._poll(fds, 1, to*1000) <= 0 || !(fds[0].revents & POLLOUT)) {
|
||||||
return (13);
|
return (13);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user