]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: proxy: add PR_FL_CHECKED flag
authorAurelien DARRAGON <adarragon@haproxy.com>
Sat, 9 Mar 2024 21:18:51 +0000 (22:18 +0100)
committerAurelien DARRAGON <adarragon@haproxy.com>
Thu, 4 Apr 2024 17:10:01 +0000 (19:10 +0200)
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
src/haproxy.c

index fb44a2cc8232f191a94f68d0ca2e933520eaa791..f387093ebc92c7ca3eb828a4587dea4235511de6 100644 (file)
@@ -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;
 
index a5f1e79ef972d1fa1e9170bad527ddc3704b31be..74b2e8ff1d15545516953915af6856686dc068d2 100644 (file)
@@ -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");