From: Amaury Denoyelle Date: Mon, 24 Mar 2025 08:32:44 +0000 (+0100) Subject: CLEANUP: quic: reorganize TP flow-control initialization X-Git-Tag: v3.2-dev9~57 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3db53202890b825a19ef9879a947d184b49003f2;p=thirdparty%2Fhaproxy.git CLEANUP: quic: reorganize TP flow-control initialization Adjust initialization of flow-control transport parameters via quic_transport_params_init(). This is purely cosmetic, with some comments added. It is also a preparatory step for future patches with addition of new configuration keywords related to flow-control TP values. --- diff --git a/src/quic_tp.c b/src/quic_tp.c index e82e2e8bb..0584cc11f 100644 --- a/src/quic_tp.c +++ b/src/quic_tp.c @@ -48,6 +48,7 @@ void quic_transport_params_init(struct quic_transport_params *p, int server) { const uint64_t stream_rx_bufsz = qmux_stream_rx_bufsz(); const int max_streams_bidi = global.tune.quic_frontend_max_streams_bidi; + /* TODO value used to conform with HTTP/3, should be derived from app_ops */ const int max_streams_uni = 3; /* Set RFC default values for unspecified parameters. */ @@ -62,12 +63,24 @@ void quic_transport_params_init(struct quic_transport_params *p, int server) else p->max_idle_timeout = global.tune.quic_backend_max_idle_timeout; - p->initial_max_streams_bidi = max_streams_bidi; - p->initial_max_streams_uni = max_streams_uni; - p->initial_max_stream_data_bidi_local = stream_rx_bufsz; + /* Set limit on number of concurrently opened streams. */ + p->initial_max_streams_bidi = max_streams_bidi; + p->initial_max_streams_uni = max_streams_uni; + + /* Set connection flow-control data limit, automatically calculated + * from max number of concurrently opened streams. + */ + p->initial_max_data = (max_streams_bidi + max_streams_uni) * stream_rx_bufsz; + + /* Set remote streams flow-control data limit. */ p->initial_max_stream_data_bidi_remote = stream_rx_bufsz * QMUX_STREAM_RX_BUF_FACTOR; + + /* Set remaining flow-control data limit. Local bidi streams are unused + * on server side. Uni streams are only used for control exchange, so + * only a single buffer for in flight data should be enough. + */ + p->initial_max_stream_data_bidi_local = stream_rx_bufsz; p->initial_max_stream_data_uni = stream_rx_bufsz; - p->initial_max_data = (max_streams_bidi + max_streams_uni) * stream_rx_bufsz; if (server) { p->with_stateless_reset_token = 1;