]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: proxy: define proxy watcher member
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Tue, 10 Feb 2026 10:18:11 +0000 (11:18 +0100)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Fri, 27 Feb 2026 09:28:24 +0000 (10:28 +0100)
Define a new member watcher_list in proxy. It will be used to register
modules which iterate over the proxies list. This will ensure that the
operation is safe even if a backend is removed in parallel.

include/haproxy/proxy-t.h
src/proxy.c

index 2c85761bf3eacf35add0f66d6e24425c7da019b5..fcf9732bd9301d0f8ab42051885228dca7b30590 100644 (file)
@@ -507,6 +507,7 @@ struct proxy {
        struct list filter_configs;             /* list of the filters that are declared on this proxy */
 
        struct guid_node guid;                  /* GUID global tree node */
+       struct mt_list watcher_list;            /* list of elems which currently references this proxy instance (currently only used with backends) */
 
        EXTRA_COUNTERS(extra_counters_fe);
        EXTRA_COUNTERS(extra_counters_be);
index 5bed1ae95adbb17cae62867edf4e6ebb50956bdd..f9241ea1deb1ba171a15ccc59b964e0e44d04732 100644 (file)
@@ -1580,6 +1580,7 @@ void init_new_proxy(struct proxy *p)
 
        p->stream_new_from_sc = stream_new;
        guid_init(&p->guid);
+       MT_LIST_INIT(&p->watcher_list);
 
        p->extra_counters_fe = NULL;
        p->extra_counters_be = NULL;