]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: server: activate automatically check reuse for rhttp@ protocol
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Wed, 2 Apr 2025 16:30:46 +0000 (18:30 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 3 Apr 2025 15:19:07 +0000 (17:19 +0200)
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
src/server.c

index 832b618b038fe829decae93dbfcb4beb272e673e..57c04f5d53a0bea4b24a89b38671efbe764ada19 100644 (file)
@@ -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
index a6892bceab6cb48996d8555572bdad13905910a3..4af5ce2d2492dc00ac171d46a9c2f68dbf3270cd 100644 (file)
@@ -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;
                        }
                }