mirror of
https://github.com/haproxy/haproxy.git
synced 2026-05-28 04:12:17 -04:00
BUG/MINOR: servers: use proper source of pool_conn_name in srv_settings_cpy()
The condition 'if (srv->pool_conn_name)' was checking the destination
instead of the source 'src->pool_conn_name', meaning the strdup() would
never fire (since newly calloc'd servers start with NULL pool_conn_name),
and the pool_conn_name setting from default-server was silently ignored.
Introduced in 3.2 with commit f0f1816f1 ("MINOR: check: implement
check-pool-conn-name srv keyword") when pool_conn_name support was added
to srv_settings_cpy(). The bug caused any 'pool-conn-name' setting in a
'default-server' line to be lost for all servers inheriting from it.
Note that it's not the first time this function induces such a bug due
to the poor choice of "srv" vs "src" that should be renamed to avoid
keyboard mistakes and visual confusion.
This needs to be backported to 3.2.
This commit is contained in:
parent
6c663a9374
commit
5b468a0820
1 changed files with 2 additions and 2 deletions
|
|
@ -3055,8 +3055,8 @@ void srv_settings_cpy(struct server *srv, const struct server *src, int srv_tmpl
|
|||
srv->tcp_ut = src->tcp_ut;
|
||||
#endif
|
||||
srv->mux_proto = src->mux_proto;
|
||||
if (srv->pool_conn_name)
|
||||
srv->pool_conn_name = strdup(srv->pool_conn_name);
|
||||
if (src->pool_conn_name)
|
||||
srv->pool_conn_name = strdup(src->pool_conn_name);
|
||||
srv->pool_purge_delay = src->pool_purge_delay;
|
||||
srv->low_idle_conns = src->low_idle_conns;
|
||||
srv->max_idle_conns = src->max_idle_conns;
|
||||
|
|
|
|||
Loading…
Reference in a new issue