]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: startup: don't use internal proxies to compute the maxconn
authorWilliam Lallemand <wlallemand@haproxy.org>
Tue, 13 Dec 2022 17:17:44 +0000 (18:17 +0100)
committerWilliam Lallemand <wlallemand@haproxy.org>
Tue, 13 Dec 2022 17:28:29 +0000 (18:28 +0100)
With internal proxies using the SSL activated (httpclient for example)
the automatic computation of the maxconn is wrong because these proxies
are always activated by default.

This patch fixes the issue by not counting these internal proxies during
the computation.

Must be backported as far as 2.5.

src/ssl_sock.c

index 0b8cfb883019caff517aed3d0ee732399c921f21..cbc1eb94b42a1bb3418847afd45c6e0f6c34b440 100644 (file)
@@ -5229,8 +5229,10 @@ int ssl_sock_prepare_srv_ctx(struct server *srv)
 {
        int cfgerr = 0;
        SSL_CTX *ctx;
-       /* Automatic memory computations need to know we use SSL there */
-       global.ssl_used_backend = 1;
+       /* Automatic memory computations need to know we use SSL there
+        * If this is an internal proxy, don't use it for the computation */
+       if (!(srv->proxy && srv->proxy->cap & PR_CAP_INT))
+               global.ssl_used_backend = 1;
 
        /* Initiate SSL context for current server */
        if (!srv->ssl_ctx.reused_sess) {