]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MEDIUM: mux-h2: Set EOI on the conn_stream during h2_rcv_buf()
authorChristopher Faulet <cfaulet@haproxy.com>
Tue, 7 May 2019 08:55:17 +0000 (10:55 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 14 May 2019 13:47:57 +0000 (15:47 +0200)
commitfa922f03a38923535ee44d37f89c96800708ce27
treee6fac0d6c2a89ed4429003975439493ab4ab5f5a
parent99ad1b3e8c95a16c0270899b3675fc29a3143a7f
BUG/MEDIUM: mux-h2: Set EOI on the conn_stream during h2_rcv_buf()

Just like CS_FL_REOS previously, the CS_FL_EOI flag is abused as a proxy
for H2_SF_ES_RCVD. The problem is that this flag is consumed by the
application layer and is set immediately when an end of stream was met,
which is too early since the application must retrieve the rxbuf's
contents first. The effect is that some transfers are truncated (mostly
the first one of a connection in most tests).

The problem of mixing CS flags and H2S flags in the H2 mux is not new
(and is currently being addressed) but this specific one was emphasized
in commit 63768a63d ("MEDIUM: mux-h2: Don't mix the end of the message
with the end of stream") which was backported to 1.9. Note that other
flags, particularly CS_FL_REOS still need to be asynchronously reported,
though their impact seems more limited for now.

This patch makes sure that all internal uses of CS_FL_EOI are replaced
with a test on H2_SF_ES_RCVD (as there is a 1-to-1 equivalence) and that
CS_FL_EOI is only reported once the rxbuf is empty.

This should ideally be backported to 1.9 unless it causes too much
trouble due to the recent changes in this area, as 1.9 *seems* not
to be directly affected by this bug.
src/mux_h2.c