]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: config: Be aware of the HTX during the check of mux protocols
authorChristopher Faulet <cfaulet@haproxy.com>
Tue, 20 Nov 2018 10:23:52 +0000 (11:23 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Tue, 20 Nov 2018 13:31:44 +0000 (14:31 +0100)
Because the HTX is still experimental, we must add special cases during the
configuration check to be sure it is not enabled on a proxy with incompatible
options. Here, for HTX proxies, when a mux protocol is specified on a bind line
or a server line, we must force the HTX mode (PROTO_MODE_HTX).

Concretely, H2 is the only mux protocol that can be forced. And it doesn't yet
support the HTX. So forcing the H2 on an HTX proxy will always fail.

src/cfgparse.c

index 2eb966377d26195366b5d4812691d4c49c8fb224..2c660ab0dae3bc6002ab4308bc530fe8ec1a1378 100644 (file)
@@ -3321,6 +3321,10 @@ out_uri_auth_compat:
                list_for_each_entry(bind_conf, &curproxy->conf.bind, by_fe) {
                        int mode = (1 << (curproxy->mode == PR_MODE_HTTP));
 
+                       /* Special case for HTX because it is still experimental */
+                       if (curproxy->options2 & PR_O2_USE_HTX)
+                               mode = PROTO_MODE_HTX;
+
                        if (!bind_conf->mux_proto)
                                continue;
                        if (!(bind_conf->mux_proto->mode & mode)) {
@@ -3335,6 +3339,10 @@ out_uri_auth_compat:
                for (newsrv = curproxy->srv; newsrv; newsrv = newsrv->next) {
                        int mode = (1 << (curproxy->mode == PR_MODE_HTTP));
 
+                       /* Special case for HTX because it is still experimental */
+                       if (curproxy->options2 & PR_O2_USE_HTX)
+                               mode = PROTO_MODE_HTX;
+
                        if (!newsrv->mux_proto)
                                continue;
                        if (!(newsrv->mux_proto->mode & mode)) {