force / no force commands added

This commit is contained in:
Vladimir Dubrovin 2016-04-02 11:43:25 +03:00
parent 2fed299b9d
commit 9bfae5faaa
4 changed files with 17 additions and 2 deletions

View File

@ -63,7 +63,7 @@ struct extparam conf = {
#else
0,
#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,
1048576,
NULL, NULL,

View File

@ -340,6 +340,17 @@ static int h_stacksize(int argc, unsigned char **argv){
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){
return 0;
}
@ -1399,6 +1410,8 @@ struct commands commandhandlers[]={
{commandhandlers+56, "delimchar",h_delimchar, 2, 2},
{commandhandlers+57, "authnserver", h_authnserver, 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}
};

View File

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

View File

@ -373,6 +373,7 @@ struct srvparam {
int nfilters, nreqfilters, nhdrfilterscli, nhdrfilterssrv, npredatfilters, ndatfilterscli, ndatfilterssrv;
int family;
int stacksize;
int noforce;
unsigned bufsize;
unsigned logdumpsrv, logdumpcli;
#ifndef NOIPV6
@ -496,7 +497,7 @@ struct extparam {
struct trafcount * trafcounter;
struct srvparam *services;
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 filtermaxsize;
unsigned char *logname, **archiver;