]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: mux-h2: also restart demuxing when data are pending in demux
authorWilly Tarreau <w@1wt.eu>
Tue, 18 Dec 2018 09:27:18 +0000 (10:27 +0100)
committerWilly Tarreau <w@1wt.eu>
Tue, 18 Dec 2018 10:03:11 +0000 (11:03 +0100)
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

index 6c160d02cb0bf5684706179e64a9a8e7d5a6dfbb..1f26701526724e16b5e8991bdc6088dd90d381ac 100644 (file)
@@ -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);
                }