BUG/MEDIUM: mux-h2: Switch pending error to error if demux buffer is empty
authorChristopher Faulet <cfaulet@haproxy.com>
Mon, 18 Dec 2023 16:53:52 +0000 (17:53 +0100)
committerWilly Tarreau <w@1wt.eu>
Thu, 15 Feb 2024 13:51:00 +0000 (14:51 +0100)
commitdff54ef10a826753d82e51c1724872a04e231a09
tree609faf6f49cda14e0b3145f2f937abf31307b2ce
parent4135266bb046baf07b32bc561c80d44b9434103d
BUG/MEDIUM: mux-h2: Switch pending error to error if demux buffer is empty

When an error on the H2 connection is detected when sending data, only a
pending error is reported, waiting for an error or a shutdown on the read
side. However if a shutdown was already received, the pending error is
switched to a definitive error.

At this stage, we must also wait to have flushed the demux
buffer. Otherwise, if some data must still be demux, messages for one or
more streams may be truncated. There is already the flag H2_CF_END_REACHED
to know a shutdown was received and we no longer progress on demux side
(buffer empty or data truncated). On sending side, we should use this flag
instead to report a definitive error.

This patch is part of a series that should fix a bug reported in issue #2388
(#2388#issuecomment-1855735144). Backport instructions will be shipped in
the last commit of the series.

(cherry picked from commit 5b78cbae770e9debab186c4bbf2b708eb4561007)
Signed-off-by: Willy Tarreau <w@1wt.eu>
src/mux_h2.c