From 28489021b334584bbfc3405447d61ce05c088c7c Mon Sep 17 00:00:00 2001 From: Patrick Hemmer Date: Tue, 1 Aug 2023 10:55:55 -0400 Subject: [PATCH] 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. --- reg-tests/sample_fetches/acl.vtc | 2 ++ src/cfgparse.c | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/reg-tests/sample_fetches/acl.vtc b/reg-tests/sample_fetches/acl.vtc index 21e6f4b52..905ae3ecf 100644 --- a/reg-tests/sample_fetches/acl.vtc +++ b/reg-tests/sample_fetches/acl.vtc @@ -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} { diff --git a/src/cfgparse.c b/src/cfgparse.c index 6e5055e37..c09d96435 100644 --- a/src/cfgparse.c +++ b/src/cfgparse.c @@ -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;