diff --git a/src/common.c b/src/common.c index b6c9cdf..4a686fe 100644 --- a/src/common.c +++ b/src/common.c @@ -92,49 +92,85 @@ char *rotations[] = { }; +int timeouts[12] = { + 1, /* SINGLEBYTE_S */ + 5, /* SINGLEBYTE_L */ + 30, /* STRING_S */ + 60, /* STRING_L */ + 180, /* CONNECTION_S */ + 1800, /* CONNECTION_L */ + 15, /* DNS_TO */ + 60, /* CHAIN_TO */ + 15, /* CONNECT_TO */ + 5, /* CONNBACK_TO */ + 0, + 0 +}; + struct extparam conf = { - {0, 0}, /* threadinit */ - {1, 5, 30, 60, 180, 1800, 15, 60, 15, 5, 0, 0}, /* timeouts */ - NULL, /* struct ace * acl; */ - NULL, /* char * conffile; */ - NULL, NULL, /* struct bandlim * bandlimiter, *bandlimiterout; */ - NULL, /* struct connlim * connlimiter; */ - NULL, /* struct trafcount * trafcounter; */ - NULL, /* struct srvparam *services; */ - 0, /* int stacksize, */ - -1, 0, 0, 0, 0, /* counterd, haveerror, rotate, paused, archiverc, */ - 0, 500, 0, 0, 0, 0, 0, 0, 2, /* demon, maxchild, backlog, needreload, timetoexit, version, noforce, bandlimver, parentretries; */ - 6, 600, /* int authcachetype, authcachetime; */ - 1048576, /* int filtermaxsize; */ - 0, 0, 0, /* int gracetraf, gracenum, gracedelay */ - 0, /* int maxseg */ - NULL, NULL, /* unsigned char *logname, **archiver; */ - NONE, NONE, /* ROTATION logtype, countertype; */ - NULL, /* char * counterfile; */ + .threadinit = {0, 0}, + .timeouts = timeouts, + .acl = NULL, + .conffile = NULL, + .bandlimiter = NULL, + .bandlimiterout = NULL, + .connlimiter = NULL, + .trafcounter = NULL, + .services = NULL, + .stacksize = 0, + .counterd = -1, + .haveerror = 0, + .rotate = 0, + .paused = 0, + .archiverc = 0, + .demon = 0, + .maxchild = 500, + .backlog = 0, + .needreload = 0, + .timetoexit = 0, + .version = 0, + .noforce = 0, + .bandlimver = 0, + .parentretries = 2, + .authcachetype = 6, + .authcachetime = 600, + .filtermaxsize = 1048576, + .gracetraf = 0, + .gracenum = 0, + .gracedelay = 0, + .maxseg = 0, + .logname = NULL, + .archiver = NULL, + .logtype = NONE, + .countertype = NONE, + .counterfile = NULL, #ifndef NOIPV6 - {AF_INET}, - {AF_INET6}, - {AF_INET}, + .intsa = {AF_INET}, + .extsa6 = {AF_INET6}, + .extsa = {AF_INET}, #else - {AF_INET}, - {AF_INET}, + .intsa = {AF_INET}, + .extsa = {AF_INET}, #endif - NULL, - NULL, - doconnect, - lognone, - NULL, - NULL, - NULL, NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - (time_t)0, (time_t)0, - 0,0, - '@', + .pwl = NULL, + .authenticate = NULL, + .authfunc = doconnect, + .logfunc = lognone, + .bandlimfunc = NULL, + .trafcountfunc = NULL, + .logtarget = NULL, + .logformat = NULL, + .fmon = NULL, + .filters = NULL, + .authfuncs = NULL, + .stdlog = NULL, + .demanddialprog = NULL, + .stringtable = NULL, + .logtime = (time_t)0, + .time = (time_t)0, + .logdumpsrv = 0, + .logdumpcli = 0, + .delimchar = '@', }; int numservers=0; diff --git a/src/proxy.h b/src/proxy.h index ed3a381..38fc353 100644 --- a/src/proxy.h +++ b/src/proxy.h @@ -154,6 +154,8 @@ extern int timetoexit; extern struct extparam conf; +extern int timeouts[12]; + int sockmap(struct clientparam * param, int timeo, int usesplice); int socksend(struct clientparam *param, SOCKET sock, unsigned char * buf, int bufsize, int to); int socksendto(struct clientparam *param, SOCKET sock, struct sockaddr * sin, unsigned char * buf, int bufsize, int to); diff --git a/src/structures.h b/src/structures.h index 1e4414b..01d59f4 100644 --- a/src/structures.h +++ b/src/structures.h @@ -643,7 +643,7 @@ struct extparam { #else int threadinit[2]; #endif - int timeouts[12]; + int *timeouts; struct ace * acl; char * conffile; struct bandlim * bandlimiter, *bandlimiterout;