mirror of
https://github.com/3proxy/3proxy.git
synced 2025-08-09 17:16:58 +08:00
Fixed: Failed connect may result in success response on some Windows versions
This commit is contained in:
parent
6916cea4eb
commit
e525ce913e
@ -488,8 +488,8 @@ int connectwithpoll(struct clientparam *param, SOCKET sock, struct sockaddr *sa,
|
|||||||
if(!errno) return 0;
|
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|POLLIN;
|
fds[0].events = POLLOUT|POLLIN|POLLERR|POLLHUP;
|
||||||
if((param?param->srv->so._poll(param->sostate, fds, 1, to*1000):so._poll(so.state, fds, 1, to*1000)) <= 0 || !(fds[0].revents & POLLOUT)) {
|
if((param?param->srv->so._poll(param->sostate, fds, 1, to*1000):so._poll(so.state, fds, 1, to*1000)) <= 0 || !(fds[0].revents & POLLOUT) || (fds[0].revents & (POLLERR|POLLHUP))) {
|
||||||
return (13);
|
return (13);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user