From 674e0addc4426cb5b42088d84975c65a2e00c547 Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Wed, 5 Dec 2018 13:45:41 +0100 Subject: [PATCH] BUG/MEDIUM: stream-int: don't mark as blocked an empty buffer on Rx After 8706c8131 ("BUG/MEDIUM: mux_pt: Always set CS_FL_RCV_MORE."), a side effect caused failed receives to mark the buffer as missing room, a flag that no other place can remove since it's empty. Ideally we need a separate flag to mean "failed to deliver data by lack of room", but in the mean time at the very least we must not mark as blocked an empty buffer. No backport is needed. --- src/stream_interface.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/stream_interface.c b/src/stream_interface.c index 3a5a39f23..73d9d4f8e 100644 --- a/src/stream_interface.c +++ b/src/stream_interface.c @@ -1214,7 +1214,8 @@ int si_cs_recv(struct conn_stream *cs) flags | (co_data(ic) ? CO_RFL_BUF_WET : 0) | ((channel_recv_limit(ic) < b_size(&ic->buf)) ? CO_RFL_KEEP_RSV : 0)); - if (cs->flags & CS_FL_RCV_MORE) + + if (b_data(&ic->buf) && (cs->flags & CS_FL_RCV_MORE)) si_rx_room_blk(si); if (cs->flags & CS_FL_READ_PARTIAL) {