From: Amaury Denoyelle Date: Thu, 17 Sep 2026 09:56:23 +0000 (+0200) Subject: MINOR: server: rename list to X-Git-Tag: v3.5-dev9~21 X-Git-Url: https://git.kaiwu.me/?a=commitdiff_plain;h=c698e8b8c8c35afb28e07600694c12575cebc8d8;p=haproxy.git MINOR: server: rename list to Now that is only used during postparsing, it is better to rename it to reflect its real purpose. The attach point in struct server is also renamed to for "alternative attach point". This is a generic name as it will be reused for another list storage during runtime. --- diff --git a/include/haproxy/server-t.h b/include/haproxy/server-t.h index 4f8960923..24ed27637 100644 --- a/include/haproxy/server-t.h +++ b/include/haproxy/server-t.h @@ -351,8 +351,10 @@ struct server { signed char use_ssl; /* ssl enabled (1: on, 0: disabled, -1 forced off) */ unsigned int flags; /* server flags (SRV_F_*) */ unsigned int pp_opts; /* proxy protocol options (SRV_PP_*) */ - struct list global_list; /* attach point in the global servers */ struct list el_px; /* attach point in parent proxy */ + struct list el_alt; /* extra attach point for several usages + * - for global list during parsing + */ int cklen; /* the len of the cookie, to speed up checks */ int rdr_len; /* the length of the redirection prefix */ char *cookie; /* the id set in the cookie */ diff --git a/include/haproxy/server.h b/include/haproxy/server.h index f4f8d9eda..97d3a1db2 100644 --- a/include/haproxy/server.h +++ b/include/haproxy/server.h @@ -44,7 +44,7 @@ extern struct idle_conns idle_conns[MAX_THREADS]; extern struct task *idle_conn_task[MAX_THREADS]; extern struct eb_root idle_conn_srv[MAX_THREADS]; -extern struct list all_servers; +extern struct list servers_to_init; extern struct dict server_key_dict; int srv_downtime(const struct server *s); @@ -402,7 +402,7 @@ static inline void srv_detach(struct server *srv) if (global.mode & MODE_STARTING) { /* Necessary if startup is interrupted due to an early error before check_config_validity(). */ - LIST_DEL_INIT(&srv->global_list); + LIST_DEL_INIT(&srv->el_alt); } /* Reset the proxy's ready_srv if it was this one. */ diff --git a/src/cfgparse.c b/src/cfgparse.c index 5081dddbd..05b225114 100644 --- a/src/cfgparse.c +++ b/src/cfgparse.c @@ -2383,11 +2383,11 @@ int check_config_validity() * we must finish to initialize certain things on the servers, * as some of the fields may be accessed soon */ - list_for_each_entry_safe(newsrv, tmpsrv, &all_servers, global_list) { + list_for_each_entry_safe(newsrv, tmpsrv, &servers_to_init, el_alt) { err_code |= srv_preinit(newsrv); if (err_code & ERR_CODE) goto out; - LIST_DEL_INIT(&newsrv->global_list); + LIST_DEL_INIT(&newsrv->el_alt); } list_for_each_entry(defpx, &defaults_list, el) { diff --git a/src/haload.c b/src/haload.c index 19b3c5328..be1c3b1aa 100644 --- a/src/haload.c +++ b/src/haload.c @@ -2373,8 +2373,8 @@ static int hld_cfg_finalize(void) if (srv_preinit(srv)) goto leave; - /* No need to stay in as srv_preinit() is manually called. */ - LIST_DEL_INIT(&srv->global_list); + /* No need to stay in as srv_preinit() is manually called. */ + LIST_DEL_INIT(&srv->el_alt); #if 0 /* XXX Must this be done? XXX */ diff --git a/src/server.c b/src/server.c index 211cb0209..3d1c390e0 100644 --- a/src/server.c +++ b/src/server.c @@ -79,7 +79,7 @@ struct srv_kw_list srv_keywords = { struct eb_root idle_conn_srv[MAX_THREADS]; struct task *idle_conn_task[MAX_THREADS] __read_mostly = {}; -struct list all_servers = LIST_HEAD_INIT(all_servers); +struct list servers_to_init = LIST_HEAD_INIT(servers_to_init); static struct task *server_atomic_sync_task = NULL; static event_hdl_async_equeue server_atomic_sync_queue; @@ -3209,9 +3209,9 @@ struct server *new_server(struct proxy *proxy) HA_RWLOCK_INIT(&srv->path_params.param_lock); - LIST_INIT(&srv->global_list); + LIST_INIT(&srv->el_alt); if (global.mode & MODE_STARTING) - LIST_APPEND(&all_servers, &srv->global_list); + LIST_APPEND(&servers_to_init, &srv->el_alt); return srv; } diff --git a/src/sink.c b/src/sink.c index 73d838ff4..7b1cfa1e8 100644 --- a/src/sink.c +++ b/src/sink.c @@ -1310,8 +1310,8 @@ struct sink *sink_new_from_logger(struct logger *logger) if (srv_preinit(srv) & ERR_CODE) goto error; - /* No need to stay in as srv_preinit() is manually called. */ - LIST_DEL_INIT(&srv->global_list); + /* No need to stay in as srv_preinit() is manually called. */ + LIST_DEL_INIT(&srv->el_alt); /* Same thing for the forward proxy: check_config_validity() has * already walked over sink_proxies_list, so this one is never