]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MEDIUM: mux-h2: Report too large HEADERS frame only when rxbuf is empty
authorChristopher Faulet <cfaulet@haproxy.com>
Wed, 13 Dec 2023 14:36:52 +0000 (15:36 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Wed, 13 Dec 2023 15:45:29 +0000 (16:45 +0100)
commit682f73b4fa6d76aa0b5b743fe92777822884772d
tree1f375b151a83d04ad633288889a53898a70612a1
parent65ca4442401c527530f5b456a8ed47a35c224480
BUG/MEDIUM: mux-h2: Report too large HEADERS frame only when rxbuf is empty

During HEADERS frames decoding, if a frame is too large to fit in a buffer,
an internal error is reported and a RST_STREAM is emitted. On the other
hand, we wait to have an empty rxbuf to decode the frame because we cannot
retry a failed HPACK decompression.

When we are decoding headers, it is valid to return an error if dbuf buffer
is full because no data can be blocked in the rxbuf (which hosts the HTX
message).

However, during the trailers decoding, it is possible to have some data not
sent yet for the current stream in the rxbug and data for another stream
fully filling the dbuf buffer. In this case, we don't decode the trailers
but we must not return an error. We must wait to empty the rxbuf first.

Now, a HEADERS frame is considered as too large if the dbuf buffer is full
and if the rxbuf is empty (the HTX message to be accurate).

This patch should fix the issue #2382. It must be backported to all stable
versions.
src/mux_h2.c