From 56d8074798772978f37fbca5667ad3d3ddc8ab20 Mon Sep 17 00:00:00 2001 From: Aurelien DARRAGON Date: Sat, 9 Mar 2024 22:18:51 +0100 Subject: [PATCH] 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. --- include/haproxy/proxy-t.h | 1 + src/haproxy.c | 1 + 2 files changed, 2 insertions(+) diff --git a/include/haproxy/proxy-t.h b/include/haproxy/proxy-t.h index fb44a2cc8..f387093eb 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 a5f1e79ef..74b2e8ff1 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"); -- 2.47.3