]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MEDIUM: proxy: use global proxy list for REGISTER_POST_PROXY_CHECK() hook
authorAurelien DARRAGON <adarragon@haproxy.com>
Fri, 9 May 2025 14:41:30 +0000 (16:41 +0200)
committerAurelien DARRAGON <adarragon@haproxy.com>
Mon, 2 Jun 2025 15:51:27 +0000 (17:51 +0200)
REGISTER_POST_PROXY_CHECK() used to iterate over "main" proxies to run
registered callbacks. This means hidden proxies (and their servers) did
not get a chance to get post-checked and could cause issues if some post-
checks are expected to be executed on all proxies no matter their type.

Instead we now rely on the global proxies list. Another side effect is that
the REGISTER_POST_SERVER_CHECK() now runs as well for servers from proxies
that are not part of the main proxies list.

src/haproxy.c

index 3a2e84f45700457f2deb12d3b5d229735ce10012..08ca84f1ca0c637df255c511ac0f3ed35f4e9b2a 100644 (file)
@@ -2101,7 +2101,7 @@ static void step_init_2(int argc, char** argv)
        clock_adjust_now_offset();
        ready_date = date;
 
-       for (px = proxies_list; px; px = px->next) {
+       list_for_each_entry(px, &proxies, global_list) {
                struct server *srv;
                struct post_proxy_check_fct *ppcf;
                struct post_server_check_fct *pscf;