BUG/MEDIUM: mux-h1: Fix handling of responses to CONNECT other than 200-ok
authorChristopher Faulet <cfaulet@haproxy.com>
Mon, 22 Feb 2021 07:11:59 +0000 (08:11 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Mon, 22 Feb 2021 09:35:45 +0000 (10:35 +0100)
commitecae6e9e3c3313ed7567b0b5799dbabfc4168da6
treefc6c95721e9282e7c1f5bf11d14b0db96a81e056
parent8c5b974f282729abefb617671e7c5910347555fa
BUG/MEDIUM: mux-h1: Fix handling of responses to CONNECT other than 200-ok

For a CONNECT request, if the tunnel establishment is refused by the server,
the connection is always closed on the client side. This happen because we
fail to detect the end of the tunnel. Now, when a reponse other than 200-ok
is received, the request is switch back to MSG_DONE state and the end of the
transaction is handled as a classical request/response exchange.

This patch should fix the issue #1140. It must be backported as far as
2.0. There is no upstream commit ID because tunnel management was already
fixed in a non-backportable way in 2.4.
src/mux_h1.c