From: Amaury Denoyelle Date: Wed, 29 Apr 2026 13:10:13 +0000 (+0200) Subject: MINOR: backend: support QMux in clear for BE side X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6717531053bd69a206f52ff24ec5e2f66371d774;p=thirdparty%2Fhaproxy.git MINOR: backend: support QMux in clear for BE side 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 from mux_proto_list is used to render the code as generic as possible. --- diff --git a/src/backend.c b/src/backend.c index 45bdb3899..726c88d60 100644 --- a/src/backend.c +++ b/src/backend.c @@ -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.