From: Amaury Denoyelle Date: Wed, 29 Jul 2026 08:42:37 +0000 (+0200) Subject: BUG/MINOR: server: fix check reuse-pool in srv_settings_cpy() X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=eeb67364c8d9ea5390353345ae9b7912b09c1024;p=thirdparty%2Fhaproxy.git BUG/MINOR: server: fix check reuse-pool in srv_settings_cpy() may be set on check to instruct that connection reuse may be performed for server health checks. As expected, this field is duplicated in srv_settings_cpy(). However, there is an exception for rHTTP servers as in this case check-reuse-pool must be forcefully activated, as performed in srv_settings_init(). Thus, the value was not copied to avoid changing it to 0. This causes a configuration issue with rHTTP on server-template though. In this case, check-reuse-pool is not set for duplicated server instances as srv_settings_init() is not called for them. This causes checks to always fail for such entries. Fix this by forcing check-reuse-pool for rHTTP in srv_settings_cpy(), and duplicate the values for other servers. This must be backported up to 3.2. --- diff --git a/src/server.c b/src/server.c index 76c8a25cc..ad7734c00 100644 --- a/src/server.c +++ b/src/server.c @@ -3000,8 +3000,12 @@ void srv_settings_cpy(struct server *srv, const struct server *src, int srv_tmpl srv->check.tcpcheck = tcpcheck; } - if (!(srv->flags & SRV_F_RHTTP)) - srv->check.reuse_pool = src->check.reuse_pool; + /* For rHTTP check-reuse-pool is forcefully set. Duplicate the source + * value in other cases as expected. + */ + srv->check.reuse_pool = srv->flags & SRV_F_RHTTP ? + 1 : src->check.reuse_pool; + if (src->check.pool_conn_name) srv->check.pool_conn_name = strdup(src->check.pool_conn_name); /* Note: 'flags' field has potentially been already initialized. */