Compare commits

...

4 Commits

Author SHA1 Message Date
Vladimir Dubrovin
2966836dfa Fixed: CONNECT does not work in standalone 'proxy' binary
Some checks failed
C/C++ CI / ${{ matrix.target }} (macos-15) (push) Has been cancelled
C/C++ CI / ${{ matrix.target }} (ubuntu-24.04-arm) (push) Has been cancelled
C/C++ CI / ${{ matrix.target }} (ubuntu-latest) (push) Has been cancelled
C/C++ CI / ${{ matrix.target }} (windows-2022) (push) Has been cancelled
2025-08-05 17:39:11 +03:00
Vladimir Dubrovin
e525ce913e Fixed: Failed connect may result in success response on some Windows versions 2025-08-05 17:38:38 +03:00
Vladimir Dubrovin
6916cea4eb Merge branch 'master' of https://github.com/3proxy/3proxy 2025-08-05 15:08:55 +03:00
Vladimir Dubrovin
db618f780b Fixed: invalid timeout in socksendto / sockrecvfrom 2025-08-05 15:07:50 +03:00
3 changed files with 8 additions and 4 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;
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;

View File

@ -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){

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*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 {