mirror of
https://github.com/3proxy/3proxy.git
synced 2025-02-23 10:35:40 +08:00
Do not terminate connection on POLLHUP if there is a data to read
This commit is contained in:
parent
cc2979ee5b
commit
6279e86086
@ -469,9 +469,6 @@ log("wait writing to client");
|
||||
CLIENTTERM = 1;
|
||||
HASERROR |= 1;
|
||||
}
|
||||
else if(fds[fdsc].revents & (POLLHUP)) {
|
||||
CLIENTTERM = 1;
|
||||
}
|
||||
else {
|
||||
if(fds[fdsc].revents & POLLIN) {
|
||||
#ifdef WITHLOG
|
||||
@ -485,6 +482,9 @@ log("ready to write to client");
|
||||
#endif
|
||||
TOCLIENT = 1;
|
||||
}
|
||||
if(fds[fdsc].revents & (POLLHUP)) {
|
||||
if(!FROMCLIENT) CLIENTTERM = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
fdsc++;
|
||||
@ -526,12 +526,6 @@ log("poll from server failed");
|
||||
SERVERTERM = 1;
|
||||
HASERROR |=2;
|
||||
}
|
||||
if(fds[fdsc].revents & (POLLHUP)) {
|
||||
#ifdef WITHLOG
|
||||
log("server terminated connection");
|
||||
#endif
|
||||
SERVERTERM = 1;
|
||||
}
|
||||
else {
|
||||
if(fds[fdsc].revents & POLLIN) {
|
||||
#ifdef WITHLOG
|
||||
@ -545,6 +539,12 @@ log("ready to write to server");
|
||||
#endif
|
||||
TOSERVER = 1;
|
||||
}
|
||||
if(fds[fdsc].revents & (POLLHUP)) {
|
||||
#ifdef WITHLOG
|
||||
log("server terminated connection");
|
||||
#endif
|
||||
if(!FROMSERVER) SERVERTERM = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
fdsc++;
|
||||
@ -581,13 +581,13 @@ log("wait reading from client pipe");
|
||||
fds[fdsc].events |= (POLLIN);
|
||||
}
|
||||
else {
|
||||
if(fds[fdsc].revents & (POLLHUP|POLLERR|POLLNVAL)){
|
||||
if(fds[fdsc].revents & (POLLERR|POLLNVAL)){
|
||||
RETURN(90);
|
||||
}
|
||||
#ifdef WITHLOG
|
||||
log("ready reading from client pipe");
|
||||
#endif
|
||||
if(fds[fdsc].revents & POLLIN) FROMCLIENTPIPE = 1;
|
||||
if(fds[fdsc].revents & (POLLHUP|POLLIN)) FROMCLIENTPIPE = 1;
|
||||
}
|
||||
fdsc++;
|
||||
}
|
||||
@ -619,13 +619,13 @@ log("wait reading from server pipe");
|
||||
fds[fdsc].events |= (POLLIN);
|
||||
}
|
||||
else {
|
||||
if(fds[fdsc].revents & (POLLHUP|POLLERR|POLLNVAL)){
|
||||
if(fds[fdsc].revents & (POLLERR|POLLNVAL)){
|
||||
RETURN(90);
|
||||
}
|
||||
#ifdef WITHLOG
|
||||
log("ready reading from server pipe");
|
||||
#endif
|
||||
if(fds[fdsc].revents & POLLIN) FROMSERVERPIPE = 1;
|
||||
if(fds[fdsc].revents & (POLLHUP|POLLIN)) FROMSERVERPIPE = 1;
|
||||
}
|
||||
fdsc++;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user