]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: proto-htx: Return an error if all headers cannot be received at once
authorChristopher Faulet <cfaulet@haproxy.com>
Mon, 21 Jan 2019 10:24:38 +0000 (11:24 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Wed, 23 Jan 2019 10:27:34 +0000 (11:27 +0100)
commitdcd8c5eed4a4843a5ccd7ae7f4c252d3ac9460d1
treebf976bf9aad0ffef160e0e77bfb697c6b73245ee
parent64ded3db2c686bad582cf9bb9fcabf21cb4becb7
BUG/MINOR: proto-htx: Return an error if all headers cannot be received at once

When an HTX stream is waiting for a request or a response, it reports an error
(400 for the request or 502 for the response) if a parsing error is reported by
the mux (HTX_FL_PARSING_ERROR). The mux-h1 uses this error, among other things,
when the headers are too big to be analyzed at once. But the mux-h2 doesn't. So
the stream must also report an error if the multiplexer is unable to emit all
headers at once. The multiplexers must always emit all the headers at once
otherwise it is an error.

There are 2 ways to detect this error:

  * The end-of-headers marker was not received yet _AND_ the HTX message is not
    empty.

  * The end-of-headers marker was not received yet _AND_ the multiplexer have
    some data to emit but it is waiting for more space in the channel's buffer.

Note the mux-h2 is buggy for now when HTX is enabled. It does not respect the
reserve. So there is no way to hit this bug.

This patch must be backported to 1.9.
src/proto_htx.c