mirror of
https://github.com/3proxy/3proxy.git
synced 2025-02-23 10:35:40 +08:00
Better connection error handling in 'proxy'
This commit is contained in:
parent
5f550c9107
commit
36f16fb899
14
src/proxy.c
14
src/proxy.c
@ -231,13 +231,14 @@ void * proxychild(struct clientparam* param) {
|
||||
SOCKET ftps;
|
||||
char ftpbuf[FTPBUFSIZE];
|
||||
int inftpbuf = 0;
|
||||
int haveconnection = 0;
|
||||
#ifndef WITHMAIN
|
||||
FILTER_ACTION action;
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
if(param->remsock != INVALID_SOCKET) haveconnection = 1;
|
||||
if(!(buf = myalloc(BUFSIZE))) {RETURN(21);}
|
||||
bufsize = BUFSIZE;
|
||||
anonymous = param->srv->anonymous;
|
||||
@ -566,7 +567,16 @@ for(;;){
|
||||
#endif
|
||||
|
||||
if(param->srv->needuser > 1 && !param->username) {RETURN(4);}
|
||||
if((res = (*param->srv->authfunc)(param))) {RETURN(res);}
|
||||
if((res = (*param->srv->authfunc)(param))) {
|
||||
if (res <= 10 || haveconnection || param->transparent) RETURN(res);
|
||||
so._closesocket(param->remsock);
|
||||
param->remsock = INVALID_SOCKET;
|
||||
param->redirected = 0;
|
||||
param->redirtype = 0;
|
||||
memset(¶m->sinsl, 0, sizeof(param->sinsl));
|
||||
memset(¶m->sinsr, 0, sizeof(param->sinsr));
|
||||
if((res = (*param->srv->authfunc)(param))) RETURN(res);
|
||||
}
|
||||
|
||||
if(ftp && param->redirtype != R_HTTP){
|
||||
SOCKET s;
|
||||
|
Loading…
Reference in New Issue
Block a user