]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: mux-h2: rely on trailers output not input to turn them to empty data
authorWilly Tarreau <w@1wt.eu>
Mon, 6 May 2019 13:13:41 +0000 (15:13 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 7 May 2019 09:07:59 +0000 (11:07 +0200)
commit5121e5d7508e3b403a844b92d31bcac7efaf6dd7
treeab3b2fb3711c6a5e83ad2047f176775d743e25cd
parent596ce52fe172c171fa29ce009262738d47fe16d3
BUG/MINOR: mux-h2: rely on trailers output not input to turn them to empty data

When sending trailers, we may face an empty HTX trailers block or even
have to discard some of the headers there and be left with nothing to
send. RFC7540 forbids sending of empty HEADERS frames, so in this case
we turn to DATA frames (which is possible since after other DATA).

The code used to only check the input frame's contents to decide whether
or not to switch to a DATA frame, it didn't consider the possibility that
the frame only used to contain headers discarded later, thus it could still
emit an empty HEADERS frame in such a case. This patch makes sure that the
output frame size is checked instead to take the decision.

This patch must be backported to 1.9. In practice this situation is never
encountered since the discarded headers have really nothing to do in a
trailers block.
src/mux_h2.c