BUG/MINOR: mux-h1: Don't pretend connection was released for TCP>H1>H2 upgrade
authorChristopher Faulet <cfaulet@haproxy.com>
Wed, 30 Apr 2025 12:16:42 +0000 (14:16 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Tue, 20 May 2025 16:07:59 +0000 (18:07 +0200)
commit60310debae66d0fffbe830168d2c1fe44ea4edd6
tree47d73f13f5bbd309a036d7515d740c2bf65bd767
parent93967e7391f6f394f310f0c5047bf50d0c480247
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.

(cherry picked from commit 2dc334be61a0a9feaa7b844e122c2c4ce37e1b1a)
Signed-off-by: Willy Tarreau <w@1wt.eu>
(cherry picked from commit 3b774ac747d54f107b25ed1c6e9e16720e78d421)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
src/mux_h1.c