From: Amaury Denoyelle Date: Wed, 29 Jul 2026 09:32:27 +0000 (+0200) Subject: MINOR: server: ensure check-reuse-pool is init in srv_settings_init() X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=41d2f146f6630de1d4be11a830a1de5af91af5b6;p=thirdparty%2Fhaproxy.git MINOR: server: ensure check-reuse-pool is init in srv_settings_init() For rHTTP servers, check-reuse-pool is forcefully set on them, else checks would always fail. This initialization was performed in _srv_parse_init(). Move this force init in srv_settings_init(). This is a better place as _srv_parse_init() should only perform minimal configuration, mostly related to server address. Then srv_settings_init() is called with the task to set every fields to suitable default values before keywords parsing. Also, this ensures that check-reuse-pool is set to 0 for non rHTTP servers. This is not strictly required though as server structure is calloc'ed. --- diff --git a/src/server.c b/src/server.c index a28b2dba4..76c8a25cc 100644 --- a/src/server.c +++ b/src/server.c @@ -2890,6 +2890,8 @@ void srv_settings_init(struct server *srv) srv->check.rise = DEF_RISETIME; srv->check.fall = DEF_FALLTIME; srv->check.port = 0; + /* Automatically activate check-reuse-pool for rhttp@ servers. */ + srv->check.reuse_pool = srv->flags & SRV_F_RHTTP ? 1 : 0; srv->agent.inter = DEF_CHKINTR; srv->agent.fastinter = 0; @@ -3797,8 +3799,6 @@ static int _srv_parse_init(struct server **srv, char **args, int *cur_arg, } else { newsrv->flags |= SRV_F_RHTTP; - /* Automatically activate check-reuse-pool for rhttp@ servers. */ - newsrv->check.reuse_pool = 1; } }