From: Aurelien DARRAGON Date: Sat, 9 Mar 2024 21:18:51 +0000 (+0100) Subject: MINOR: proxy: add PR_FL_CHECKED flag X-Git-Tag: v3.0-dev7~14 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=56d8074798772978f37fbca5667ad3d3ddc8ab20;p=thirdparty%2Fhaproxy.git MINOR: proxy: add PR_FL_CHECKED flag PR_FL_CHECKED is set on proxy once the proxy configuration was fully checked (including postparsing checks). This information may be useful to functions that need to know if some config-related proxy properties are likely to change or not due to parsing or postparsing/check logics. Also, during runtime, except for some rare cases config-related proxy properties are not supposed to be changed. --- diff --git a/include/haproxy/proxy-t.h b/include/haproxy/proxy-t.h index fb44a2cc82..f387093ebc 100644 --- a/include/haproxy/proxy-t.h +++ b/include/haproxy/proxy-t.h @@ -214,6 +214,7 @@ enum PR_SRV_STATE_FILE { #define PR_FL_EXPLICIT_REF 0x08 /* The default proxy is explicitly referenced by another proxy */ #define PR_FL_IMPLICIT_REF 0x10 /* The default proxy is implicitly referenced by another proxy */ #define PR_FL_PAUSED 0x20 /* The proxy was paused at run time (reversible) */ +#define PR_FL_CHECKED 0x40 /* The proxy configuration was fully checked (including postparsing checks) */ struct stream; diff --git a/src/haproxy.c b/src/haproxy.c index a5f1e79ef9..74b2e8ff1d 100644 --- a/src/haproxy.c +++ b/src/haproxy.c @@ -2338,6 +2338,7 @@ static void init(int argc, char **argv) } list_for_each_entry(ppcf, &post_proxy_check_list, list) err_code |= ppcf->fct(px); + px->flags |= PR_FL_CHECKED; } if (err_code & (ERR_ABORT|ERR_FATAL)) { ha_alert("Fatal errors found in configuration.\n");