From: Amaury Denoyelle Date: Wed, 29 Apr 2026 13:10:44 +0000 (+0200) Subject: MINOR: session: support QMux in clear on FE side X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=812962d11089aab65f69bcf555e0cd17b608eb27;p=thirdparty%2Fhaproxy.git MINOR: session: support QMux in clear on FE side Activates xprt_qmux layer if necessary via session_accept_fd(). This is necessary to be able to support QMux in clear. This operation is noop if SSL is active, as in this case xprt_qmux will be activated after the SSL handshake completion. To ensure MUX init is delayed when running with clear QMux, mask CO_FL_WAIT_XPRT_L6 is added to test if the embryonic task must be started instead. --- diff --git a/src/session.c b/src/session.c index a9c8c6d85..d5bd4ea95 100644 --- a/src/session.c +++ b/src/session.c @@ -241,14 +241,17 @@ int session_accept_fd(struct connection *cli_conn) if (l->bind_conf->options & BC_O_ACC_CIP) cli_conn->flags |= CO_FL_ACCEPT_CIP; - if (l->bind_conf->mux_proto && l->bind_conf->mux_proto->init_xprt == XPRT_QMUX) - cli_conn->flags |= (CO_FL_QMUX_RECV|CO_FL_QMUX_SEND); - /* Add the handshake pseudo-XPRT */ if (cli_conn->flags & (CO_FL_ACCEPT_PROXY | CO_FL_ACCEPT_CIP)) { if (xprt_add_hs(cli_conn) != 0) goto out_free_conn; } + + /* Add handshake layer prior to MUX init if required. Does nothing if SSL layer is active though. */ + if (l->bind_conf->mux_proto && l->bind_conf->mux_proto->init_xprt) { + if (xprt_add_l6hs(cli_conn, l->bind_conf->mux_proto->init_xprt)) + goto out_free_conn; + } } /* Reversed conns already have an assigned session, do not recreate it. */ @@ -351,7 +354,7 @@ int session_accept_fd(struct connection *cli_conn) * v | | | * conn -- owner ---> task <-----+ */ - if (cli_conn->flags & (CO_FL_WAIT_XPRT | CO_FL_EARLY_SSL_HS)) { + if (cli_conn->flags & (CO_FL_WAIT_XPRT | CO_FL_EARLY_SSL_HS | CO_FL_WAIT_XPRT_L6)) { int timeout; int clt_tmt = p->timeout.client; int hs_tmt = p->timeout.client_hs;