BUG/MAJOR: mux-h1: Don't pretend the input channel's buffer is full if empty
authorChristopher Faulet <cfaulet@haproxy.com>
Fri, 20 Dec 2019 16:33:24 +0000 (17:33 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Fri, 20 Dec 2019 17:09:19 +0000 (18:09 +0100)
commit6716cc2b934d00eb4a91caaf9971348141951a13
tree0a05f072e3f4f4c817e361ef4629eea3c237875b
parentca7a5af664504cbe13240e5bc538efbcef4f6162
BUG/MAJOR: mux-h1: Don't pretend the input channel's buffer is full if empty

A regression was introduced by the commit 76014fd1 ("MEDIUM: h1-htx: Add HTX EOM
block when the message is in H1_MSG_DONE state"). When nothing is copied in the
channel's buffer when the input message is parsed, we erroneously pretend it is
because there is not enough room by setting the CS_FL_WANT_ROOM flag on the
conn-stream. This happens when a partial request is parsed. Because of this
flag, we never try anymore to get input data from the mux because we first wait
for more room in the channel's buffer, which is empty. Because of this bug, it
is pretty easy to freeze a h1 connection.

To fix the bug, we must obsiously set the CS_FL_WANT_ROOM flag only when there
are still data to transfer while the channel's buffer is not empty.

This patch must be backported if the patch 76014fd1 is backported too. So for
now, no backport needed.
src/mux_h1.c