Move timeouts from conf
Some checks are pending
C/C++ CI / ${{ matrix.target }} (macos-15) (push) Waiting to run
C/C++ CI / ${{ matrix.target }} (ubuntu-24.04-arm) (push) Waiting to run
C/C++ CI / ${{ matrix.target }} (ubuntu-latest) (push) Waiting to run
C/C++ CI / ${{ matrix.target }} (windows-2022) (push) Waiting to run

This commit is contained in:
Vladimir Dubrovin 2026-04-01 19:37:33 +03:00
parent 46be1fb96c
commit 5cb42abbb3
3 changed files with 78 additions and 40 deletions

View File

@ -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 = { struct extparam conf = {
{0, 0}, /* threadinit */ .threadinit = {0, 0},
{1, 5, 30, 60, 180, 1800, 15, 60, 15, 5, 0, 0}, /* timeouts */ .timeouts = timeouts,
NULL, /* struct ace * acl; */ .acl = NULL,
NULL, /* char * conffile; */ .conffile = NULL,
NULL, NULL, /* struct bandlim * bandlimiter, *bandlimiterout; */ .bandlimiter = NULL,
NULL, /* struct connlim * connlimiter; */ .bandlimiterout = NULL,
NULL, /* struct trafcount * trafcounter; */ .connlimiter = NULL,
NULL, /* struct srvparam *services; */ .trafcounter = NULL,
0, /* int stacksize, */ .services = NULL,
-1, 0, 0, 0, 0, /* counterd, haveerror, rotate, paused, archiverc, */ .stacksize = 0,
0, 500, 0, 0, 0, 0, 0, 0, 2, /* demon, maxchild, backlog, needreload, timetoexit, version, noforce, bandlimver, parentretries; */ .counterd = -1,
6, 600, /* int authcachetype, authcachetime; */ .haveerror = 0,
1048576, /* int filtermaxsize; */ .rotate = 0,
0, 0, 0, /* int gracetraf, gracenum, gracedelay */ .paused = 0,
0, /* int maxseg */ .archiverc = 0,
NULL, NULL, /* unsigned char *logname, **archiver; */ .demon = 0,
NONE, NONE, /* ROTATION logtype, countertype; */ .maxchild = 500,
NULL, /* char * counterfile; */ .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 #ifndef NOIPV6
{AF_INET}, .intsa = {AF_INET},
{AF_INET6}, .extsa6 = {AF_INET6},
{AF_INET}, .extsa = {AF_INET},
#else #else
{AF_INET}, .intsa = {AF_INET},
{AF_INET}, .extsa = {AF_INET},
#endif #endif
NULL, .pwl = NULL,
NULL, .authenticate = NULL,
doconnect, .authfunc = doconnect,
lognone, .logfunc = lognone,
NULL, .bandlimfunc = NULL,
NULL, .trafcountfunc = NULL,
NULL, NULL, .logtarget = NULL,
NULL, .logformat = NULL,
NULL, .fmon = NULL,
NULL, .filters = NULL,
NULL, .authfuncs = NULL,
NULL, .stdlog = NULL,
NULL, .demanddialprog = NULL,
(time_t)0, (time_t)0, .stringtable = NULL,
0,0, .logtime = (time_t)0,
'@', .time = (time_t)0,
.logdumpsrv = 0,
.logdumpcli = 0,
.delimchar = '@',
}; };
int numservers=0; int numservers=0;

View File

@ -154,6 +154,8 @@ extern int timetoexit;
extern struct extparam conf; extern struct extparam conf;
extern int timeouts[12];
int sockmap(struct clientparam * param, int timeo, int usesplice); int sockmap(struct clientparam * param, int timeo, int usesplice);
int socksend(struct clientparam *param, SOCKET sock, unsigned char * buf, int bufsize, int to); 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); int socksendto(struct clientparam *param, SOCKET sock, struct sockaddr * sin, unsigned char * buf, int bufsize, int to);

View File

@ -643,7 +643,7 @@ struct extparam {
#else #else
int threadinit[2]; int threadinit[2];
#endif #endif
int timeouts[12]; int *timeouts;
struct ace * acl; struct ace * acl;
char * conffile; char * conffile;
struct bandlim * bandlimiter, *bandlimiterout; struct bandlim * bandlimiter, *bandlimiterout;