mirror of
https://github.com/3proxy/3proxy.git
synced 2025-09-07 10:57:12 +08:00
Compare commits
4 Commits
6c2ba01394
...
2966836dfa
Author | SHA1 | Date | |
---|---|---|---|
![]() |
2966836dfa | ||
![]() |
e525ce913e | ||
![]() |
6916cea4eb | ||
![]() |
db618f780b |
@ -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;
|
||||
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].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))) {
|
||||
return (13);
|
||||
}
|
||||
return 0;
|
||||
|
@ -506,10 +506,14 @@ 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){
|
||||
|
@ -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*1000):so._poll(so.state, &fds, 1, to*1000);
|
||||
res = param?param->srv->so._poll(param->sostate, &fds, 1, to):so._poll(so.state, &fds, 1, to);
|
||||
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*1000):so._poll(so.state, &fds, 1, to*1000);
|
||||
res = param?param->srv->so._poll(param->sostate, &fds, 1, to):so._poll(so.state, &fds, 1, to);
|
||||
if (res<1) return 0;
|
||||
sasize = SASIZE(sin);
|
||||
do {
|
||||
|
Loading…
Reference in New Issue
Block a user