]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MEDIUM: mux-h2: Increase max number of headers when encoding HEADERS frames
authorChristopher Faulet <cfaulet@haproxy.com>
Wed, 20 Nov 2024 15:02:53 +0000 (16:02 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Wed, 20 Nov 2024 16:44:22 +0000 (17:44 +0100)
commite415e3cb7aa1feaac3ed703687656e09dd464eb3
treec7c0b2211cad0a3dd6be70d03ab97d6f5b08d41d
parent349954601f5d13351f0ed4a6bfbdd90de01717ab
BUG/MEDIUM: mux-h2: Increase max number of headers when encoding HEADERS frames

When a HEADERS frame is encoded to be sent, the maximum number of headers
allowed in the frame is lower than on receiving path. This can lead to
report a sending error while the message was accepted. It could be
confusing.

In addition, the start-line is splitted into pseudo-headers and consummes
this way some header slots, increasing the difference between HEADERS frames
encoding and decoding. It is even more noticeable because when a HEADERS
frame is decoded, a margin is used to be able to handle splitted cookie
headers. Concretly, on decoding path, a limit of twice the maxumum number of
headers allowed in a message (tune.http.maxhdr * 2) is used. On encoding
path, the exact limit is used. It is not consistent.

Note that when a frame is decoded, we must use a larger limit because the
pseudo headers are reassembled in the start-line and must count for one. But
also because, most of time, the cookies are splitted into several headers
and are reassembled too.

To fix the issue, the same ratio is applied on sending path. A limit must be
defined because an dynamic allocation is not acceptable. Twice of the
configured limit should be good enough to support headers manipulation.

This patch should be backported to all stable versions.
src/mux_h2.c