]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: backend: support QMux in clear for BE side quic-interop flx04/quic-interop
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Wed, 29 Apr 2026 13:10:13 +0000 (15:10 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 21 May 2026 13:09:10 +0000 (15:09 +0200)
Use xprt_add_l6hs() at the end of connect_server() if selected MUX layer
relies on a temporary handshake prior to its initialization. This
functions is noop is SSL layer is active.

This change is necessary to support clear QMux on the backend side.
Recently defined <init_xprt> from mux_proto_list is used to render the
code as generic as possible.

src/backend.c

index 45bdb38990814e4de7459364a083030f49882370..726c88d6083f518ca0d7cc1dbee6092f0416ba8b 100644 (file)
@@ -1818,7 +1818,7 @@ int connect_server(struct stream *s)
 {
        struct connection *cli_conn = objt_conn(strm_orig(s));
        struct connection *srv_conn = NULL;
-       const struct mux_proto_list *mux_proto;
+       const struct mux_proto_list *mux_proto = NULL;
        struct server *srv;
        struct ist name = IST_NULL;
        struct sample *name_smp;
@@ -2139,12 +2139,10 @@ int connect_server(struct stream *s)
                }
 
                if (may_start_mux_now) {
-                       /* Delay QMux MUX init to let xprt_qmux handshake runs first. */
+                       /* Delay MUX init if an XPRT handshake is required prior. */
                        mux_proto = conn_select_mux_be(srv_conn);
-                       if (mux_proto && mux_proto->init_xprt == XPRT_QMUX) {
-                               srv_conn->flags |= (CO_FL_QMUX_RECV|CO_FL_QMUX_SEND);
+                       if (mux_proto && mux_proto->init_xprt)
                                may_start_mux_now = 0;
-                       }
                }
 
 #if defined(USE_OPENSSL) && defined(TLSEXT_TYPE_application_layer_protocol_negotiation)
@@ -2254,6 +2252,13 @@ int connect_server(struct stream *s)
                        }
                }
        }
+       else if (mux_proto && mux_proto->init_xprt) {
+               /* Add handshake layer prior to MUX init if required. Does nothing if SSL layer is active though. */
+               if (xprt_add_l6hs(srv_conn, mux_proto->init_xprt)) {
+                       conn_full_close(srv_conn);
+                       return SF_ERR_INTERNAL;
+               }
+       }
 
        /*
         * Now that the mux may have been created, we can start the xprt.