]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: cfgparse: use curproxy global var from config post validation
authorPatrick Hemmer <patrick.hemmer@gmail.com>
Tue, 1 Aug 2023 14:55:55 +0000 (10:55 -0400)
committerWilly Tarreau <w@1wt.eu>
Mon, 6 May 2024 16:45:47 +0000 (18:45 +0200)
Previously check_config_validity() had its own curproxy variable. This
resulted in the acl() sample fetch being unable to determine which
proxy was in use when used from within log-format statements. This
change addresses the issue by having the check_config_validity()
function use the global variable instead.

reg-tests/sample_fetches/acl.vtc
src/cfgparse.c

index 21e6f4b52417a700bc75f153890afa46280d5f6a..905ae3ecf474c36d2ab33c42217a620349cc3633 100644 (file)
@@ -19,6 +19,8 @@ haproxy h1 -conf {
         acl ACL4 acl(ACL2,!ACL3)
 
         http-request return status 200 hdr x-acl "ACL1=%[acl(ACL1)] ACL2=%[acl(ACL2)] ACL3=%[acl(ACL3)] ACL4=%[acl(ACL4)] TRUE=%[acl(TRUE)]"
+
+        log-format ACL1=%[acl(ACL1)]
 } -start
 
 client c1 -connect ${h1_fe1_sock} {
index 6e5055e37e24b35f25e5955065e699260ccc32c8..c09d96435494d86286cfddf9f155ded9371f4d45 100644 (file)
@@ -2705,7 +2705,6 @@ static int numa_detect_topology()
 int check_config_validity()
 {
        int cfgerr = 0;
-       struct proxy *curproxy = NULL;
        struct proxy *init_proxies_list = NULL;
        struct stktable *t;
        struct server *newsrv = NULL;