]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: htx: Exclude TCP proxies when the HTX mode is handled during startup
authorChristopher Faulet <cfaulet@haproxy.com>
Wed, 24 Apr 2019 13:25:00 +0000 (15:25 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Wed, 24 Apr 2019 13:40:02 +0000 (15:40 +0200)
When tests are performed on the HTX mode during HAProxy startup, only HTTP
proxies are considered. It is important because, since the commit 1d2b586cd
("MAJOR: htx: Enable the HTX mode by default for all proxies"), the HTX is
enabled on all proxies by default. But for TCP proxies, it is "deactivated".

This patch must be backported to 1.9.

src/cfgparse.c
src/http_htx.c

index ffff9cc6b8efc548e93aaf30dbbc1db6f3990d08..9a03a02bba25d4a7332efd6245a1a7424bbc0df2 100644 (file)
@@ -3484,8 +3484,8 @@ out_uri_auth_compat:
                        int mode = (1 << (curproxy->mode == PR_MODE_HTTP));
                        const struct mux_proto_list *mux_ent;
 
-                       /* Special case for HTX because it is still experimental */
-                       if (curproxy->options2 & PR_O2_USE_HTX)
+                       /* Special case for HTX because legacy HTTP still exists */
+                       if (mode == PROTO_MODE_HTTP && (curproxy->options2 & PR_O2_USE_HTX))
                                mode = PROTO_MODE_HTX;
 
                        if (!bind_conf->mux_proto)
@@ -3513,8 +3513,8 @@ out_uri_auth_compat:
                        int mode = (1 << (curproxy->mode == PR_MODE_HTTP));
                        const struct mux_proto_list *mux_ent;
 
-                       /* Special case for HTX because it is still experimental */
-                       if (curproxy->options2 & PR_O2_USE_HTX)
+                       /* Special case for HTX because legacy HTTP still exists */
+                       if (mode == PROTO_MODE_HTTP && (curproxy->options2 & PR_O2_USE_HTX))
                                mode = PROTO_MODE_HTX;
 
                        if (!newsrv->mux_proto)
index 21a5b57f416a3684962b4aa2a8d30f7aef3c288f..8a407cdff4ea69b695224683cb4deebbf7befcb9 100644 (file)
@@ -714,7 +714,7 @@ static int http_htx_init(void)
        int err_code = 0;
 
        for (px = proxies_list; px; px = px->next) {
-               if (!(px->options2 & PR_O2_USE_HTX))
+               if (px->mode != PR_MODE_HTTP || !(px->options2 & PR_O2_USE_HTX))
                        continue;
 
                for (rc = 0; rc < HTTP_ERR_SIZE; rc++) {