]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: mux-h1: Don't perform implicit HTTP/2 upgrade if not supported by mux
authorChristopher Faulet <cfaulet@haproxy.com>
Mon, 8 Mar 2021 14:32:03 +0000 (15:32 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Thu, 1 Apr 2021 09:06:47 +0000 (11:06 +0200)
For now this tests is useless, but if the H1 muliplexer is flagged to
explicitly not support the upgrades to HTTP/2, an error is returned.

src/mux_h1.c

index 656c0a1bce2f97527033a25eff733f42fffe943a..13110de926f5e1f5c7d8508e442d0c68c2b6bee4 100644 (file)
@@ -2665,7 +2665,8 @@ static int h1_process(struct h1c * h1c)
 
                /* First of all handle H1 to H2 upgrade (no need to create the H1 stream) */
                if (!(h1c->flags & H1C_F_WAIT_NEXT_REQ) &&         /* First request */
-                   !(h1c->px->options2 & PR_O2_NO_H2_UPGRADE)) {  /* H2 upgrade supported by the proxy */
+                   !(h1c->px->options2 & PR_O2_NO_H2_UPGRADE) &&  /* H2 upgrade supported by the proxy */
+                   !(conn->mux->flags & MX_FL_NO_UPG)) {          /* the current mux supports upgrades */
                        /* Try to match H2 preface before parsing the request headers. */
                        if (b_isteq(&h1c->ibuf, 0, b_data(&h1c->ibuf), ist(H2_CONN_PREFACE)) > 0) {
                                h1c->flags |= H1C_F_UPG_H2C;