]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MEDIUM: mux-h1: Don't release H1 stream upgraded from TCP on error
authorChristopher Faulet <cfaulet@haproxy.com>
Thu, 15 Dec 2022 08:22:35 +0000 (09:22 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Thu, 15 Dec 2022 08:51:31 +0000 (09:51 +0100)
commitda93802ffc5c38b470b95d250a9c0b496349ca64
treeb609d70edda48936b799148447be89787bc6b708
parentf5994fc69268603b686c37fb38e5086f98ec1880
BUG/MEDIUM: mux-h1: Don't release H1 stream upgraded from TCP on error

When an error occurred during the request parsing, the H1 multiplexer is
responsible to sent a response to the client and to release the H1 stream
and the H1 connection. In HTTP mode, it is not an issue because at this
stage the H1 connection is in embryonic state. Thus it can be released
immediately.

However, it is a problem if the connection was first upgraded from a TCP
connection. In this case, a stream-connector is attached. The H1 stream is
not orphan. Thus it must not be released at this stage. It must be detached
first. Otherwise a BUG_ON() is triggered in h1s_destroy().

So now, the H1S is destroyed on early errors but only if the H1C is in
embryonic state.

This patch may be related to #1966. It must be backported to 2.7.
reg-tests/connection/tcp_to_http_upgrade.vtc
src/mux_h1.c