From 28116e307a1e9af321521dedd05faa5a7cb2f53c Mon Sep 17 00:00:00 2001 From: Amaury Denoyelle Date: Wed, 2 Apr 2025 18:30:46 +0200 Subject: [PATCH] MINOR: server: activate automatically check reuse for rhttp@ protocol Without check-reuse-pool, it is impossible to perform check on server using @rhttp protocol. This is due to the inherent nature of the protocol which does not implement an active connect method. Thus, ensure that check-reuse-pool is always set when a reverse HTTP server is declared. This reduces server configuration and should prevent any omission. Note that it is still require to add "check" server keyword so activate server checks. --- doc/configuration.txt | 5 ++--- src/server.c | 5 ++++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/doc/configuration.txt b/doc/configuration.txt index 832b618b0..57c04f5d5 100644 --- a/doc/configuration.txt +++ b/doc/configuration.txt @@ -18215,9 +18215,8 @@ check-reuse-pool any specific check connect option is defined, either on the server line or via a custom tcp-check connect rule. - If checks are activated for a reverse HTTP server, this option is mandatory - for checks to succeed, as by definition these servers do not have the ability - to initiate connection. + This option is automatically enabled for servers acting as passive reverse + HTTP gateway, as for those servers connect is only supported through reuse. check-send-proxy May be used in the following contexts: tcp, http diff --git a/src/server.c b/src/server.c index a6892bcea..4af5ce2d2 100644 --- a/src/server.c +++ b/src/server.c @@ -2852,7 +2852,8 @@ void srv_settings_cpy(struct server *srv, const struct server *src, int srv_tmpl srv->check.sni = src->check.sni; srv->check.alpn_str = src->check.alpn_str; srv->check.alpn_len = src->check.alpn_len; - srv->check.reuse_pool = src->check.reuse_pool; + if (!(srv->flags & SRV_F_RHTTP)) + srv->check.reuse_pool = src->check.reuse_pool; /* Note: 'flags' field has potentially been already initialized. */ srv->flags |= src->flags; srv->do_check = src->do_check; @@ -3505,6 +3506,8 @@ 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; } }