extern char *cfg_scope;
extern struct cfg_kw_list cfg_keywords;
extern char *cursection;
-extern struct proxy defproxy;
int cfg_parse_global(const char *file, int linenum, char **args, int inv);
int cfg_parse_listen(const char *file, int linenum, char **args, int inv);
#include <haproxy/tcpcheck.h>
#include <haproxy/uri_auth.h>
+
+static struct proxy defproxy; /* fake proxy used to assign default values on all instances */
+
/* Report a warning if a rule is placed after a 'tcp-request session' rule.
* Return 1 if the warning has been emitted, otherwise 0.
*/
char *errmsg = NULL;
struct bind_conf *bind_conf;
+ if (defproxy.obj_type != OBJ_TYPE_PROXY) {
+ /* defproxy not initialized yet */
+ init_new_proxy(&defproxy);
+ proxy_preset_defaults(&defproxy);
+ }
+
if (strcmp(args[0], "listen") == 0)
rc = PR_CAP_LISTEN;
else if (strcmp(args[0], "frontend") == 0)
struct list postparsers = LIST_HEAD_INIT(postparsers);
char *cursection = NULL;
-struct proxy defproxy = { }; /* fake proxy used to assign default values on all instances */
int cfg_maxpconn = 0; /* # of simultaneous connections per proxy (-N) */
int cfg_maxconn = 0; /* # of simultaneous connections, (-n) */
char *cfg_scope = NULL; /* the current scope during the configuration parsing */
global.maxsock = 10; /* reserve 10 fds ; will be incremented by socket eaters */
- init_new_proxy(&defproxy);
- proxy_preset_defaults(&defproxy);
-
/* in wait mode, we don't try to read the configuration files */
if (!(global.mode & MODE_MWORKER_WAIT)) {
char *env_cfgfiles = NULL;