diff --git a/include/haproxy/mux_quic-t.h b/include/haproxy/mux_quic-t.h index 5be71cfbb..93b756c9c 100644 --- a/include/haproxy/mux_quic-t.h +++ b/include/haproxy/mux_quic-t.h @@ -53,6 +53,7 @@ struct qcc { struct list frms; /* prepared frames related to flow-control */ uint64_t ms_bidi_init; /* max initial sub-ID of bidi stream allowed for the peer */ + uint64_t ms_bidi_rel; /* max relative sub-ID of bidi stream allowed for the peer */ uint64_t ms_bidi; /* max sub-ID of bidi stream allowed for the peer */ uint64_t cl_bidi_r; /* total count of closed remote bidi stream since last MAX_STREAMS emission */ diff --git a/src/mux_quic.c b/src/mux_quic.c index 50a478bd0..0504b9a4b 100644 --- a/src/mux_quic.c +++ b/src/mux_quic.c @@ -2483,7 +2483,7 @@ static int qcc_release_remote_stream(struct qcc *qcc, uint64_t id) /* MAX_STREAMS needed if closed streams value more than twice * the initial window or reaching the stream ID limit. */ - if (qcc->lfctl.cl_bidi_r > qcc->lfctl.ms_bidi_init / 2 || + if (qcc->lfctl.cl_bidi_r > qcc->lfctl.ms_bidi_rel / 2 || qcc->lfctl.cl_bidi_r + qcc->lfctl.ms_bidi == max) { TRACE_DATA("increase max stream limit with MAX_STREAMS_BIDI", QMUX_EV_QCC_SEND, qcc->conn); frm = qc_frm_alloc(QUIC_FT_MAX_STREAMS_BIDI); @@ -3587,9 +3587,9 @@ static void qcc_release(struct qcc *qcc) TRACE_PROTO("application layer released", QMUX_EV_QCC_END, conn); if (!(qcc->flags & QC_CF_IS_BACK) && global.tune.streams_elasticity && - qcc->lfctl.ms_bidi_init > 1) { + qcc->lfctl.ms_bidi_rel > 1) { _HA_ATOMIC_SUB(&tg_ctx->committed_extra_streams, - qcc->lfctl.ms_bidi_init - 1); + qcc->lfctl.ms_bidi_rel - 1); } if (conn && !conn_is_quic(conn)) { @@ -3855,7 +3855,7 @@ static int qcm_init(struct connection *conn, struct proxy *prx, /* Server parameters, params used for RX flow control. */ lparams = &conn->handle.qc->rx.params; - qcc->lfctl.ms_bidi = qcc->lfctl.ms_bidi_init = lparams->initial_max_streams_bidi; + qcc->lfctl.ms_bidi = qcc->lfctl.ms_bidi_init = qcc->lfctl.ms_bidi_rel = 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; @@ -3884,7 +3884,7 @@ static int qcm_init(struct connection *conn, struct proxy *prx, qcc->rfctl.msd_uni_l = rparams->initial_max_stream_data_uni; lparams = xprt_qmux_lparams(conn->xprt_ctx); - qcc->lfctl.ms_bidi = qcc->lfctl.ms_bidi_init = lparams->initial_max_streams_bidi; + qcc->lfctl.ms_bidi = qcc->lfctl.ms_bidi_init = qcc->lfctl.ms_bidi_rel= 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; @@ -4648,7 +4648,7 @@ static int qcm_ctl(struct connection *conn, enum mux_ctl_type mux_ctl, void *out return qcc->nb_hreq; case MUX_CTL_GET_MAXSTRM: - return qcc->lfctl.ms_bidi_init; + return qcc->lfctl.ms_bidi_rel; case MUX_CTL_TEVTS: return qcc->term_evts_log;