diff --git a/src/mux_quic.c b/src/mux_quic.c index 8ce0ac71a..21f082770 100644 --- a/src/mux_quic.c +++ b/src/mux_quic.c @@ -4054,9 +4054,6 @@ static size_t qmux_strm_snd_buf(struct stconn *sc, struct buffer *buf, TRACE_ENTER(QMUX_EV_STRM_SEND, qcs->qcc->conn, qcs); - /* Stream must not be woken up if already waiting for conn buffer. */ - BUG_ON(LIST_INLIST(&qcs->el_buf)); - /* Sending forbidden if QCS is locally closed (FIN or RESET_STREAM sent). */ BUG_ON(qcs_is_close_local(qcs) || (qcs->flags & QC_SF_TO_RESET)); @@ -4070,6 +4067,11 @@ static size_t qmux_strm_snd_buf(struct stconn *sc, struct buffer *buf, goto end; } + if (LIST_INLIST(&qcs->el_buf)) { + TRACE_DEVEL("leaving on no buf avail", QMUX_EV_STRM_SEND, qcs->qcc->conn, qcs); + goto end; + } + if (qfctl_sblocked(&qcs->qcc->tx.fc)) { TRACE_DEVEL("leaving on connection flow control", QMUX_EV_STRM_SEND, qcs->qcc->conn, qcs); @@ -4120,9 +4122,6 @@ static size_t qmux_strm_nego_ff(struct stconn *sc, struct buffer *input, TRACE_ENTER(QMUX_EV_STRM_SEND, qcs->qcc->conn, qcs); - /* Stream must not be woken up if already waiting for conn buffer. */ - BUG_ON(LIST_INLIST(&qcs->el_buf)); - /* Sending forbidden if QCS is locally closed (FIN or RESET_STREAM sent). */ BUG_ON(qcs_is_close_local(qcs) || (qcs->flags & QC_SF_TO_RESET)); @@ -4144,6 +4143,12 @@ static size_t qmux_strm_nego_ff(struct stconn *sc, struct buffer *input, goto end; } + if (LIST_INLIST(&qcs->el_buf)) { + TRACE_DEVEL("leaving on no buf avail", QMUX_EV_STRM_SEND, qcs->qcc->conn, qcs); + qcs->sd->iobuf.flags |= IOBUF_FL_FF_BLOCKED; + goto end; + } + if (qfctl_sblocked(&qcs->qcc->tx.fc)) { TRACE_DEVEL("leaving on connection flow control", QMUX_EV_STRM_SEND, qcs->qcc->conn, qcs); if (!LIST_INLIST(&qcs->el_fctl)) {