From: Willy Tarreau Date: Tue, 1 Aug 2023 09:18:00 +0000 (+0200) Subject: BUILD: cfgparse: keep a single "curproxy" X-Git-Tag: v2.9-dev3~78 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bbc3e4463e1e745ed4f9d9e2a45be5bd48b6365b;p=thirdparty%2Fhaproxy.git BUILD: cfgparse: keep a single "curproxy" Surprisingly, commit 00e00fb42 ("REORG: cfgparse: extract curproxy as a global variable") caused a build breakage on the CI but not on two developers' machines. It looks like it's dependent on the linker version used. What happens is that flt_spoe.c already has a curproxy struct which already is a copy of the one passed by the parser because it also needed it to be exported, so they now conflict. Let's just drop this unused copy. --- diff --git a/src/cfgparse.c b/src/cfgparse.c index 2948a51fa1..7cc829d468 100644 --- a/src/cfgparse.c +++ b/src/cfgparse.c @@ -102,7 +102,7 @@ struct list postparsers = LIST_HEAD_INIT(postparsers); extern struct proxy *mworker_proxy; /* curproxy is only valid during parsing and will be NULL afterwards. */ -struct proxy *curproxy; +struct proxy *curproxy = NULL; char *cursection = NULL; int cfg_maxpconn = 0; /* # of simultaneous connections per proxy (-N) */ diff --git a/src/flt_spoe.c b/src/flt_spoe.c index 65f20cec19..6fc3023c2a 100644 --- a/src/flt_spoe.c +++ b/src/flt_spoe.c @@ -71,9 +71,6 @@ const char *spoe_filter_id = "SPOE filter"; /* Set if the handle on SIGUSR1 is registered */ static int sighandler_registered = 0; -/* proxy used during the parsing */ -struct proxy *curproxy = NULL; - /* The name of the SPOE engine, used during the parsing */ char *curengine = NULL; @@ -4169,12 +4166,11 @@ parse_spoe_flt(char **args, int *cur_arg, struct proxy *px, cfg_register_section("spoe-message", cfg_parse_spoe_message, NULL); /* Parse SPOE filter configuration file */ + BUG_ON(px != curproxy); curengine = engine; - curproxy = px; curagent = NULL; curmsg = NULL; ret = readcfgfile(file); - curproxy = NULL; /* unregister SPOE sections and restore previous sections */ cfg_unregister_sections();