BUG/MEDIUM: proxy: Make sure to destroy the stream on upgrade from TCP to H2
authorOlivier Houchard <ohouchard@haproxy.com>
Wed, 31 Jul 2019 16:05:26 +0000 (18:05 +0200)
committerOlivier Houchard <cognet@ci0.org>
Fri, 2 Aug 2019 16:28:58 +0000 (18:28 +0200)
commit4c18f94c11b11e4a4923892ed0fa72385ec1eb08
treeadc2637ddffea4231feeca0301ea1759d159c32e
parent1d4a0f88100daeb17dd0c9470c659b1ec288bc07
BUG/MEDIUM: proxy: Make sure to destroy the stream on upgrade from TCP to H2

In stream_set_backend(), if we have a TCP stream, and we want to upgrade it
to H2 instead of attempting ot reuse the stream, just destroy the
conn_stream, make sure we don't log anything about the stream, and pretend
we failed setting the backend, so that the stream will get destroyed.
New streams will then be created by the mux, as if the connection just
happened.
This fixes a crash when upgrading from TCP to H2, as the H2 mux totally
ignored the conn_stream provided by the upgrade, as reported in github
issue #196.

This should be backported to 2.0.
include/types/stream.h
src/proxy.c
src/stream.c