]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: proxy: rename proxies list to all_proxies master
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Mon, 20 Jul 2026 13:14:52 +0000 (15:14 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 23 Jul 2026 14:03:20 +0000 (16:03 +0200)
Rename global list <proxies> to <all_proxies>. This better highlights
the difference with the other list <main_proxies>. The first one contain
every proxy instances, whereas the second list is only a subset of user
visible proxies.

In the future, it should be sufficient to only keep <all_proxies> list.
However, this requires careful code analysis, in particular to ensure
proxies iteration are always executed with the proper capabilities
filter.

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

index 9b6fa5b9ea41fd0728b55d6ce3a4caa37f2a0f65..ff1526801653adbbb3c7af15310f363be82d19a8 100644 (file)
@@ -36,7 +36,7 @@
 #include <haproxy/thread.h>
 
 extern struct list main_proxies;
-extern struct list proxies;
+extern struct list all_proxies;
 extern struct ceb_root *used_proxy_id;  /* list of proxy IDs in use */
 extern unsigned int error_snapshot_id;  /* global ID assigned to each error then incremented */
 extern struct ceb_root *proxy_by_name;    /* tree of proxies sorted by name */
index 69d5414ea17777559277a8d841cb1c02a2560073..5838271a4b98564bd54d768442560bba46bf6022 100644 (file)
@@ -2258,7 +2258,7 @@ static void step_init_2(int argc, char** argv)
        clock_adjust_now_offset();
        ready_date = date;
 
-       list_for_each_entry(px, &proxies, global_list) {
+       list_for_each_entry(px, &all_proxies, global_list) {
                struct server *srv;
                struct post_proxy_check_fct *ppcf;
                struct post_server_check_fct *pscf;
index af90dcbbf9f7e7359aa7b9f0199b920ce5740c63..7a87d79de69c577d01b956c2e5c2a640b7bcd1b6 100644 (file)
@@ -82,7 +82,7 @@ struct list main_proxies = LIST_HEAD_INIT(main_proxies);
 /* List of all proxies, except defaults.
  * Currently only used for post_proxy_check_fct and post_server_check_fct post init.
  */
-struct list proxies = LIST_HEAD_INIT(proxies);
+struct list all_proxies = LIST_HEAD_INIT(all_proxies);
 
 struct ceb_root *used_proxy_id = NULL; /* list of proxy IDs in use */
 struct ceb_root *proxy_by_name = NULL; /* tree of proxies sorted by name */
@@ -3214,7 +3214,7 @@ int setup_new_proxy(struct proxy *px, const char *name, unsigned int cap, char *
                proxy_store_name(px);
 
        if (!(cap & PR_CAP_DEF))
-               LIST_APPEND(&proxies, &px->global_list);
+               LIST_APPEND(&all_proxies, &px->global_list);
 
        return 1;
 
@@ -4978,7 +4978,7 @@ static int cli_parse_add_backend(char **args, char *payload, struct appctx *appc
        dynpx_next_id = px->uuid;
 
        /* Insert <px> into <main_proxies> list of visible proxies. Note that
-        * insertion in <proxies> has already been performed in
+        * insertion in <all_proxies> has already been performed in
         * setup_new_proxy() via alloc_new_proxy().
         */
        main_proxies_register(px);