Merge branch 'devel' of https://github.com/z3APA3A/3proxy into devel

This commit is contained in:
z3APA3A 2016-04-04 13:43:30 +03:00
commit 1d162abec3
5 changed files with 18 additions and 3 deletions

View File

@ -63,7 +63,7 @@ struct extparam conf = {
#else #else
0, 0,
#endif #endif
0, -1, 0, 0, 0, 0, 0, 500, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 500, 0, 0, 0, 0, 0,
6, 600, 6, 600,
1048576, 1048576,
NULL, NULL, NULL, NULL,

View File

@ -341,6 +341,17 @@ static int h_stacksize(int argc, unsigned char **argv){
return 0; return 0;
} }
static int h_force(int argc, unsigned char **argv){
conf.noforce = 0;
return 0;
}
static int h_noforce(int argc, unsigned char **argv){
conf.noforce = 1;
return 0;
}
static int h_service(int argc, unsigned char **argv){ static int h_service(int argc, unsigned char **argv){
return 0; return 0;
} }
@ -1400,6 +1411,8 @@ struct commands commandhandlers[]={
{commandhandlers+56, "delimchar",h_delimchar, 2, 2}, {commandhandlers+56, "delimchar",h_delimchar, 2, 2},
{commandhandlers+57, "authnserver", h_authnserver, 2, 2}, {commandhandlers+57, "authnserver", h_authnserver, 2, 2},
{commandhandlers+58, "stacksize", h_stacksize, 2, 2}, {commandhandlers+58, "stacksize", h_stacksize, 2, 2},
{commandhandlers+59, "force", h_force, 1, 1},
{commandhandlers+60, "noforce", h_noforce, 1, 1},
{specificcommands, "", h_noop, 1, 0} {specificcommands, "", h_noop, 1, 0}
}; };

View File

@ -713,6 +713,7 @@ void srvinit(struct srvparam * srv, struct clientparam *param){
srv->version = conf.version + 1; srv->version = conf.version + 1;
srv->paused = conf.paused; srv->paused = conf.paused;
srv->logfunc = conf.logfunc; srv->logfunc = conf.logfunc;
srv->noforce = conf.noforce;
if(srv->logformat)myfree(srv->logformat); if(srv->logformat)myfree(srv->logformat);
srv->logformat = conf.logformat? (unsigned char *)mystrdup((char *)conf.logformat) : NULL; srv->logformat = conf.logformat? (unsigned char *)mystrdup((char *)conf.logformat) : NULL;
srv->authfunc = conf.authfunc; srv->authfunc = conf.authfunc;

View File

@ -69,7 +69,7 @@ int sockmap(struct clientparam * param, int timeo){
while (!stop&&!conf.timetoexit){ while (!stop&&!conf.timetoexit){
sasize = sizeof(struct sockaddr_in); sasize = sizeof(struct sockaddr_in);
if(param->version < conf.version){ if(param->version < conf.version){
if (res = (*param->srv->authfunc)(param)) {return(res);} if((res = (*param->srv->authfunc)(param)) && !param->srv->noforce) {return(res);}
param->paused = conf.paused; param->paused = conf.paused;
param->version = conf.version; param->version = conf.version;
} }

View File

@ -373,6 +373,7 @@ struct srvparam {
int nfilters, nreqfilters, nhdrfilterscli, nhdrfilterssrv, npredatfilters, ndatfilterscli, ndatfilterssrv; int nfilters, nreqfilters, nhdrfilterscli, nhdrfilterssrv, npredatfilters, ndatfilterscli, ndatfilterssrv;
int family; int family;
int stacksize; int stacksize;
int noforce;
unsigned bufsize; unsigned bufsize;
unsigned logdumpsrv, logdumpcli; unsigned logdumpsrv, logdumpcli;
#ifndef NOIPV6 #ifndef NOIPV6
@ -496,7 +497,7 @@ struct extparam {
struct trafcount * trafcounter; struct trafcount * trafcounter;
struct srvparam *services; struct srvparam *services;
int stacksize, threadinit, counterd, haveerror, rotate, paused, archiverc, int stacksize, threadinit, counterd, haveerror, rotate, paused, archiverc,
demon, maxchild, singlepacket, needreload, timetoexit, version; demon, maxchild, singlepacket, needreload, timetoexit, version, noforce;
int authcachetype, authcachetime; int authcachetype, authcachetime;
int filtermaxsize; int filtermaxsize;
unsigned char *logname, **archiver; unsigned char *logname, **archiver;