BUG/MEDIUM: stream: Be sure to never assign a TCP backend to an HTX stream
authorChristopher Faulet <cfaulet@haproxy.com>
Fri, 20 Dec 2019 14:59:20 +0000 (15:59 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Fri, 20 Dec 2019 17:09:49 +0000 (18:09 +0100)
commiteec7f8ac01cb744bc30f50327dd989b4763e0205
tree1e24012e5296fd5c6d5c46ffb377a71ca9aab169
parent6716cc2b934d00eb4a91caaf9971348141951a13
BUG/MEDIUM: stream: Be sure to never assign a TCP backend to an HTX stream

With a TCP frontend, it is possible to upgrade a connection to HTTP when the
backend is in HTTP mode. Concretly the upgrade install a new mux. So, once it is
done, the downgrade to TCP is no longer possible. So we must take care to never
assign a TCP backend to a stream on this connection. Otherwise, HAProxy crashes
because raw data from the server are handled as structured data on the client
side.

This patch fixes the issue #420. It must be backported to all versions
supporting the HTX.
src/proxy.c