From: Christopher Faulet Date: Wed, 30 Apr 2025 12:16:42 +0000 (+0200) Subject: BUG/MINOR: mux-h1: Don't pretend connection was released for TCP>H1>H2 upgrade X-Git-Tag: v3.2-dev13~19 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2dc334be61a0a9feaa7b844e122c2c4ce37e1b1a;p=thirdparty%2Fhaproxy.git BUG/MINOR: mux-h1: Don't pretend connection was released for TCP>H1>H2 upgrade When an applicative upgrade of the H1 multiplexer is performed, we must not pretend the connection was released. Indeed, in that case, a H1 stream is still their with a stream connector attached on it. It must be detached first before releasing the H1 connection and the underlying connection. So it is important to not pretend the connection was already released. Concretely, in that case h1_process() must return 0 instead of -1. It is minor error because, AFAIK, it is harmless. But it is not correct. So let's fix it to avoid futur bugs. To be clear, this happens when a TCP connection is upgraded to H1 connection and a H2 preface is detected, leading to a second upgrade from H1 to H2. This patch may be backport to all stable versions. --- diff --git a/src/mux_h1.c b/src/mux_h1.c index 864d3cce2..6fef116bd 100644 --- a/src/mux_h1.c +++ b/src/mux_h1.c @@ -4250,6 +4250,7 @@ static int h1_process(struct h1c * h1c) } h1_alert(h1s); TRACE_DEVEL("waiting to release the SC before releasing the connection", H1_EV_H1C_WAKE); + return 0; } else { h1_release(h1c);