MINOR: cfgparse: add struct cfgfile to represent config in memory

This and following commits serve to prepare loading configuration files in
memory, before parsing them, as we may need to parse some parts of
configuration in different moments of the startup sequence. This is a case of
the new master-worker initialization process. Here we need to read at first
only the global and the program sections and only after some steps
(forking worker, etc) the rest of the configuration.

Add a new structure cfgfile to keep configuration files metadata and content,
loaded somewhere in a memory. Instances of filled cfgfile structures could be
chained in a list, as the order in which they were loaded is important.
This commit is contained in:
Valentine Krasnobaeva 2024-08-05 10:03:00 +02:00 committed by Willy Tarreau
parent a6d1eb8f5d
commit 70b842e847

View File

@ -90,6 +90,14 @@ struct cfg_postparser {
int (*func)();
};
/* store in memory config files meta data and content */
struct cfgfile {
struct list list;
char *filename; /* config file name */
char *content; /* allocated str with config file content */
ssize_t size; /* size of stored file or error indication (-1) */
};
extern struct list postparsers;
extern int cfg_maxpconn;
extern int cfg_maxconn;