diff options
| author | Christopher Faulet <cfaulet@haproxy.com> | 2021-10-13 11:04:10 +0200 |
|---|---|---|
| committer | Christopher Faulet <cfaulet@haproxy.com> | 2021-10-15 14:12:19 +0200 |
| commit | ff556276eb809da0ec4c816beacad6294c982301 (patch) | |
| tree | c9973fa757448143b6adee1805a49d795c35894a | |
| parent | 56717803e1f8dbe16a825a0dc8a35953a324e9cc (diff) | |
| download | haproxy-ff556276eb809da0ec4c816beacad6294c982301.tar.gz | |
MINOR: config: Finish configuration for referenced default proxies
If a not-ready default proxy is referenced by a proxy during the
configuration validity check, its configuration is also finished and
PR_FL_READY flag is set on it.
For now, the arguments resolution is the only step performed.
This patch is mandatory to support TCP/HTTP rules in defaults sections.
| -rw-r--r-- | src/cfgparse.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/cfgparse.c b/src/cfgparse.c index 1db94c652..02ddd959d 100644 --- a/src/cfgparse.c +++ b/src/cfgparse.c @@ -2514,6 +2514,28 @@ int check_config_validity() continue; } + /* The current proxy is referencing a default proxy. We must + * finalize its config, but only once. If the default proxy is + * ready (PR_FL_READY) it means it was already fully configured. + */ + if (curproxy->defpx) { + if (!(curproxy->defpx->flags & PR_FL_READY)) { + err = NULL; + i = smp_resolve_args(curproxy->defpx, &err); + cfgerr += i; + if (i) { + indent_msg(&err, 8); + ha_alert("%s%s\n", i > 1 ? "multiple argument resolution errors:" : "", err); + ha_free(&err); + } + else + cfgerr += acl_find_targets(curproxy->defpx); + + /* default proxy is now ready. Set the right FE/BE capabilities */ + curproxy->defpx->flags |= PR_FL_READY; + } + } + /* check and reduce the bind-proc of each listener */ list_for_each_entry(bind_conf, &curproxy->conf.bind, by_fe) { unsigned long mask; |
