From c5b1004fbe14b739762b1032f6e227411a79e70c Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Tue, 18 Dec 2018 10:27:18 +0100 Subject: [PATCH] BUG/MEDIUM: mux-h2: also restart demuxing when data are pending in demux Commit 082f559d3 ("BUG/MEDIUM: h2: restart demuxing after releasing buffer space") tried to address a situation where transfers could stall after a read, but the condition was not completely covered : some stalls may still happen at end of stream because there's nothing anymore to receive and the last data lie in the demux buffer. Thus we must also consider this state as a valid condition to restart demuxing. No backport is needed. --- src/mux_h2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mux_h2.c b/src/mux_h2.c index 6c160d02c..1f2670152 100644 --- a/src/mux_h2.c +++ b/src/mux_h2.c @@ -4631,7 +4631,7 @@ static size_t h2_rcv_buf(struct conn_stream *cs, struct buffer *buf, size_t coun if (ret && h2c->dsi == h2s->id) { /* demux is blocking on this stream's buffer */ h2c->flags &= ~H2_CF_DEM_SFULL; - if (!(h2c->wait_event.wait_reason & SUB_CAN_RECV)) { + if (b_data(&h2c->dbuf) || !(h2c->wait_event.wait_reason & SUB_CAN_RECV)) { if (h2_recv_allowed(h2c)) tasklet_wakeup(h2c->wait_event.task); }