From: Olivier Houchard Date: Fri, 9 Aug 2019 16:01:15 +0000 (+0200) Subject: BUG/MEDIUM: proxy: Don't use cs_destroy() when freeing the conn_stream. X-Git-Tag: v2.1-dev2~212 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=59dd06d6599f0a6d9131343272efa398de257bf0;p=thirdparty%2Fhaproxy.git BUG/MEDIUM: proxy: Don't use cs_destroy() when freeing the conn_stream. When we upgrade the mux from TCP to H2/HTX, don't use cs_destroy() to free the conn_stream, use cs_free() instead. Using cs_destroy() would call the mux detach method, and at that point of time the mux would be the H2 mux, which knows nothing about that conn_stream, so bad things would happen. This should eventually make upgrade from TCP to H2/HTX work, and fix the github issue #196. This should be backported to 2.0. --- diff --git a/src/proxy.c b/src/proxy.c index 1abb780e6d..0976681307 100644 --- a/src/proxy.c +++ b/src/proxy.c @@ -1464,7 +1464,7 @@ int stream_set_backend(struct stream *s, struct proxy *be) * silently destroyed. The new mux * will create new streams. */ - cs_destroy(cs); + cs_free(cs); si_detach_endpoint(&s->si[0]); s->logs.logwait = 0; s->logs.level = 0;