]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: stream-int: don't mark as blocked an empty buffer on Rx
authorWilly Tarreau <w@1wt.eu>
Wed, 5 Dec 2018 12:45:41 +0000 (13:45 +0100)
committerWilly Tarreau <w@1wt.eu>
Wed, 5 Dec 2018 12:45:41 +0000 (13:45 +0100)
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

index 3a5a39f23c913ab7daeec16b875dc30487609b3e..73d9d4f8e0883a626002cb0e586233df869ac85d 100644 (file)
@@ -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) {