]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: quic-be: do not create the mux after handshake completion (for 0-RTT)
authorFrederic Lecaille <flecaille@haproxy.com>
Thu, 6 Nov 2025 14:15:43 +0000 (15:15 +0100)
committerFrederic Lecaille <flecaille@haproxy.com>
Thu, 6 Nov 2025 17:14:01 +0000 (18:14 +0100)
This is required during connection with 0-RTT support, to prevent two mux creations.
Indeed, for 0-RTT sessions, the QUIC mux is already started very soon from
connect_server() (src/backend.c).

src/quic_ssl.c

index 4d7798b86b5e389e719e212e93a2990afe544d5b..6031cadabdbfd886f539c9f8f25c2f6dbb3b741d 100644 (file)
@@ -1014,13 +1014,15 @@ int qc_ssl_do_hanshake(struct quic_conn *qc, struct ssl_sock_ctx *ctx)
                                goto err;
                        }
 
-                       if (conn_create_mux(qc->conn, NULL) < 0) {
-                               TRACE_ERROR("mux creation failed", QUIC_EV_CONN_IO_CB, qc, &state);
-                               goto err;
-                       }
+                       if (!qc_is_conn_ready(qc)) {
+                               if (conn_create_mux(qc->conn, NULL) < 0) {
+                                       TRACE_ERROR("mux creation failed", QUIC_EV_CONN_IO_CB, qc, &state);
+                                       goto err;
+                               }
 
-                       /* Wake up MUX after its creation. Operation similar to TLS+ALPN on TCP stack. */
-                       qc->conn->mux->wake(qc->conn);
+                               /* Wake up MUX after its creation. Operation similar to TLS+ALPN on TCP stack. */
+                               qc->conn->mux->wake(qc->conn);
+                       }
                }
                else {
                        TRACE_PROTO("could not start the mux", QUIC_EV_CONN_IO_CB, qc);