BUG/MINOR: cfgparse: use curproxy global var from config post validation

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.
This commit is contained in:
Patrick Hemmer 2023-08-01 10:55:55 -04:00 committed by Willy Tarreau
parent 93d4e99714
commit 28489021b3
2 changed files with 2 additions and 1 deletions

View 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} {

View 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;