]> git.kaiwu.me - haproxy.git/commitdiff
MINOR: mux_quic: remove duplicate QMux local transport params
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Mon, 13 Apr 2026 07:15:37 +0000 (09:15 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Mon, 13 Apr 2026 07:38:46 +0000 (09:38 +0200)
When QMux was first implemented, values used for emitted transport
parameters in xprt_qstrm and local flow control in mux_quic were
initialized separately. This is error prone in particular if a value is
change in one layer but not the other.

This patch fixes this by using xprt_qstrm_lparams() in QMux init
function. Mux flow control is then loaded with these values. Thus all
values are now initialized in a single place which is xprt_qstrm_init().

src/mux_quic.c

index 0fe0c7c6f515e8c5705694fa4be6548717c748ba..ad2da8aabe47555cdecc5cacb1216fc2cba29640 100644 (file)
@@ -3755,15 +3755,15 @@ static int qmux_init(struct connection *conn, struct proxy *prx,
                qcc->rfctl.msd_bidi_r = rparams->initial_max_stream_data_bidi_remote;
                qcc->rfctl.msd_uni_l = rparams->initial_max_stream_data_uni;
 
-               /* TODO */
-               qcc->lfctl.ms_bidi = qcc->lfctl.ms_bidi_init = 16384;
-               qcc->lfctl.ms_uni = 3;
-               qcc->lfctl.msd_bidi_l = 16384;
-               qcc->lfctl.msd_bidi_r = 16384;
-               qcc->lfctl.msd_uni_r = 16384;
+               lparams = xprt_qstrm_lparams(conn->xprt_ctx);
+               qcc->lfctl.ms_bidi = qcc->lfctl.ms_bidi_init = lparams->initial_max_streams_bidi;
+               qcc->lfctl.ms_uni = lparams->initial_max_streams_uni;
+               qcc->lfctl.msd_bidi_l = lparams->initial_max_stream_data_bidi_local;
+               qcc->lfctl.msd_bidi_r = lparams->initial_max_stream_data_bidi_remote;
+               qcc->lfctl.msd_uni_r = lparams->initial_max_stream_data_uni;
                qcc->lfctl.cl_bidi_r = 0;
 
-               qcc->lfctl.md = qcc->lfctl.md_init = 16384;
+               qcc->lfctl.md = qcc->lfctl.md_init = lparams->initial_max_data;
                qcc->lfctl.offsets_recv = qcc->lfctl.offsets_consume = 0;
        }