From: Willy Tarreau Date: Tue, 18 Dec 2018 09:27:18 +0000 (+0100) Subject: BUG/MEDIUM: mux-h2: also restart demuxing when data are pending in demux X-Git-Tag: v1.9.0~40 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c5b1004fbe14b739762b1032f6e227411a79e70c;p=thirdparty%2Fhaproxy.git 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. --- diff --git a/src/mux_h2.c b/src/mux_h2.c index 6c160d02cb..1f26701526 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); }