Skip to content

Commit e0940bf

Browse files
committed
MAJOR: mux_quic: release bidi stream only when all sent data is ACKed
1 parent e3bd220 commit e0940bf

3 files changed

Lines changed: 7 additions & 5 deletions

File tree

include/haproxy/mux_quic.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ int qcc_recv_max_stream_data(struct qcc *qcc, uint64_t id, uint64_t max);
5353
int qcc_recv_max_streams(struct qcc *qcc, uint64_t max, int bidi);
5454
int qcc_recv_reset_stream(struct qcc *qcc, uint64_t id, uint64_t err, uint64_t final_size);
5555
int qcc_recv_stop_sending(struct qcc *qcc, uint64_t id, uint64_t err);
56+
int qcc_release_remote_stream(struct qcc *qcc, uint64_t id);
5657

5758
static inline int qcm_stream_rx_bufsz(void)
5859
{

src/mux_quic.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,8 @@ static void qcs_free(struct qcs *qcs)
118118
}
119119
else if (!conn_is_quic(qcc->conn)) {
120120
b_free(&qcs->tx.qmux_buf);
121+
if (quic_stream_is_remote(qcc, qcs->id))
122+
qcc_release_remote_stream(qcc, qcs->id);
121123
}
122124

123125
/* Free Rx buffer. */
@@ -2480,7 +2482,7 @@ int qcc_recv_stop_sending(struct qcc *qcc, uint64_t id, uint64_t err)
24802482
/* Signal the closing of remote stream with id <id>. Flow-control for new
24812483
* streams may be allocated for the peer if needed.
24822484
*/
2483-
static int qcc_release_remote_stream(struct qcc *qcc, uint64_t id)
2485+
int qcc_release_remote_stream(struct qcc *qcc, uint64_t id)
24842486
{
24852487
struct quic_frame *frm;
24862488
uint64_t conn_max, rem, non_extra, inc;
@@ -2574,7 +2576,6 @@ static void qcs_destroy(struct qcs *qcs)
25742576
{
25752577
struct qcc *qcc = qcs->qcc;
25762578
struct connection *conn = qcc->conn;
2577-
const uint64_t id = qcs->id;
25782579

25792580
TRACE_ENTER(QMUX_EV_QCS_END, conn, qcs);
25802581

@@ -2583,9 +2584,6 @@ static void qcs_destroy(struct qcs *qcs)
25832584
* to ensure consistency on connection flow-control calculation.
25842585
*/
25852586
BUG_ON(qcs->tx.fc.off_soft != qcs->tx.fc.off_real);
2586-
2587-
if (quic_stream_is_remote(qcc, id))
2588-
qcc_release_remote_stream(qcc, id);
25892587
}
25902588

25912589
qcs_free(qcs);

src/quic_stream.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -419,6 +419,9 @@ void qc_stream_desc_free(struct qc_stream_desc *stream, int closing)
419419
++free_count;
420420
}
421421

422+
if (stream->ctx && quic_stream_is_remote(stream->ctx, stream->by_id.key))
423+
qcc_release_remote_stream(stream->ctx, stream->by_id.key);
424+
422425
if (free_count)
423426
offer_buffers(NULL, free_count);
424427

0 commit comments

Comments
 (0)