]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: quic: do not use hardcoded values in QMux TP frame builder
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Mon, 13 Apr 2026 11:34:10 +0000 (13:34 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Mon, 13 Apr 2026 11:38:11 +0000 (13:38 +0200)
Reuse QUIC transport parameters value set in xprt_qstrm layer in frame
builder function. Prior to this patch, mux_quic would use different
values from the advertised ones.

No need to backport.

src/quic_frame.c
src/xprt_qstrm.c

index 1cb2006fddb9d5ff2ca5cda49100d0ccafa04cb8..bf17fe8fc676f8367f4932b3a943a5f1b8a432bd 100644 (file)
@@ -1017,6 +1017,7 @@ static int quic_build_handshake_done_frame(unsigned char **pos, const unsigned c
 static int quic_build_qmux_transport_parameters(unsigned char **pos, const unsigned char *end,
                                                 struct quic_frame *frm, struct quic_conn *conn)
 {
+       struct qf_qx_transport_parameters *params_frm = &frm->qmux_transport_params;
        unsigned char *old = *pos;
        struct buffer buf;
 
@@ -1030,19 +1031,19 @@ static int quic_build_qmux_transport_parameters(unsigned char **pos, const unsig
                return 0;
        *pos += 8;
 
-       if (!quic_transport_param_enc_int(pos, end, QUIC_TP_MAX_IDLE_TIMEOUT, 30000))
+       if (!quic_transport_param_enc_int(pos, end, QUIC_TP_MAX_IDLE_TIMEOUT, params_frm->params.max_idle_timeout))
                return 0;
-       if (!quic_transport_param_enc_int(pos, end, QUIC_TP_INITIAL_MAX_DATA, 16384))
+       if (!quic_transport_param_enc_int(pos, end, QUIC_TP_INITIAL_MAX_DATA, params_frm->params.initial_max_data))
                return 0;
-       if (!quic_transport_param_enc_int(pos, end, QUIC_TP_INITIAL_MAX_STREAM_DATA_BIDI_LOCAL, 16384))
+       if (!quic_transport_param_enc_int(pos, end, QUIC_TP_INITIAL_MAX_STREAM_DATA_BIDI_LOCAL, params_frm->params.initial_max_stream_data_bidi_local))
                return 0;
-       if (!quic_transport_param_enc_int(pos, end, QUIC_TP_INITIAL_MAX_STREAM_DATA_BIDI_REMOTE, 16384))
+       if (!quic_transport_param_enc_int(pos, end, QUIC_TP_INITIAL_MAX_STREAM_DATA_BIDI_REMOTE, params_frm->params.initial_max_stream_data_bidi_remote))
                return 0;
-       if (!quic_transport_param_enc_int(pos, end, QUIC_TP_INITIAL_MAX_STREAM_DATA_UNI, 16384))
+       if (!quic_transport_param_enc_int(pos, end, QUIC_TP_INITIAL_MAX_STREAM_DATA_UNI, params_frm->params.initial_max_stream_data_uni))
                return 0;
-       if (!quic_transport_param_enc_int(pos, end, QUIC_TP_INITIAL_MAX_STREAMS_BIDI, 100))
+       if (!quic_transport_param_enc_int(pos, end, QUIC_TP_INITIAL_MAX_STREAMS_BIDI, params_frm->params.initial_max_streams_bidi))
                return 0;
-       if (!quic_transport_param_enc_int(pos, end, QUIC_TP_INITIAL_MAX_STREAMS_UNI, 100))
+       if (!quic_transport_param_enc_int(pos, end, QUIC_TP_INITIAL_MAX_STREAMS_UNI, params_frm->params.initial_max_streams_uni))
                return 0;
 
        /* Re-encode the real length field now. */
index 2c5b147f0ac8eafa8602c8adf77181cdd2f3e17c..5d4ff94be11b5ba776bf7a15075f4cac03471744 100644 (file)
@@ -268,6 +268,8 @@ static int xprt_qstrm_init(struct connection *conn, void **xprt_ctx)
        memset(&ctx->rparams, 0, sizeof(struct quic_transport_params));
 
        /* TP configuration advertised by us */
+       ctx->lparams.max_idle_timeout = 30;
+       ctx->lparams.initial_max_data = 1638400;
        ctx->lparams.initial_max_streams_bidi = 100;
        ctx->lparams.initial_max_streams_uni = 3;
        ctx->lparams.initial_max_stream_data_bidi_local = qmux_stream_rx_bufsz();