diff --git a/src/mux_quic.c b/src/mux_quic.c index f89d4502f784..2f550f758eef 100644 --- a/src/mux_quic.c +++ b/src/mux_quic.c @@ -37,6 +37,11 @@ static void qcs_free_ncbuf(struct qcs *qcs, struct ncbuf *ncbuf) offer_buffers(NULL, 1); *ncbuf = NCBUF_NULL; + + /* Reset DEM_FULL as buffer is released. This ensures mux is not woken + * up from rcv_buf stream callback when demux was previously blocked. + */ + qcs->flags &= ~QC_SF_DEM_FULL; } /* Free instance. This function is reserved for internal usage : it must @@ -2743,9 +2748,8 @@ static size_t qmux_strm_rcv_buf(struct stconn *sc, struct buffer *buf, /* Restart demux if it was interrupted on full buffer. */ if (ret && qcs->flags & QC_SF_DEM_FULL) { - /* There must be data left for demux if it was interrupted on - * full buffer. If this assumption is incorrect wakeup is not - * necessary. + /* Ensure DEM_FULL is only set if there is available data to + * ensure we never do unnecessary wakeup here. */ BUG_ON(!ncb_data(&qcs->rx.ncbuf, 0));