Compare commits

..

No commits in common. "2966836dfaa87d2a19a60b9271d3572b7121c9fb" and "6c2ba01394b9a1f9976ab73b0796c821958c744f" have entirely different histories.

3 changed files with 4 additions and 8 deletions

View File

@ -488,8 +488,8 @@ int connectwithpoll(struct clientparam *param, SOCKET sock, struct sockaddr *sa,
if(!errno) return 0;
memset(fds, 0, sizeof(fds));
fds[0].fd = sock;
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) || (fds[0].revents & (POLLERR|POLLHUP))) {
fds[0].events = POLLOUT|POLLIN;
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)) {
return (13);
}
return 0;

View File

@ -506,14 +506,10 @@ for(;;){
if(action != PASS) RETURN(517);
param->nolongdatfilter = 0;
#endif
if(isconnect && param->redirtype != R_HTTP) {
socksend(param, param->clisock, (unsigned char *)proxy_stringtable[8], (int)strlen(proxy_stringtable[8]), conf.timeouts[STRING_S]);
}
#ifndef WITHMAIN
if (param->npredatfilters){
action = handlepredatflt(param);
if(action == HANDLED){

View File

@ -39,7 +39,7 @@ int socksendto(struct clientparam *param, SOCKET sock, struct sockaddr * sin, un
do {
if(conf.timetoexit) return 0;
fds.events = POLLOUT;
res = param?param->srv->so._poll(param->sostate, &fds, 1, to):so._poll(so.state, &fds, 1, to);
res = param?param->srv->so._poll(param->sostate, &fds, 1, to*1000):so._poll(so.state, &fds, 1, to*1000);
if(res < 0 && (errno == EAGAIN || errno == EINTR)) continue;
if(res < 1) break;
res = param?param->srv->so._sendto(param->sostate, sock, (char *)buf + sent, bufsize - sent, 0, sin, SASIZE(sin)):so._sendto(so.state, sock, (char *)buf + sent, bufsize - sent, 0, sin, SASIZE(sin));
@ -60,7 +60,7 @@ int sockrecvfrom(struct clientparam *param, SOCKET sock, struct sockaddr * sin,
fds.fd = sock;
fds.events = POLLIN;
if(conf.timetoexit) return EOF;
res = param?param->srv->so._poll(param->sostate, &fds, 1, to):so._poll(so.state, &fds, 1, to);
res = param?param->srv->so._poll(param->sostate, &fds, 1, to*1000):so._poll(so.state, &fds, 1, to*1000);
if (res<1) return 0;
sasize = SASIZE(sin);
do {