]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MEDIUM: h2: check that the connection is still valid at the end of init()
authorWilly Tarreau <w@1wt.eu>
Wed, 3 Oct 2018 12:22:21 +0000 (14:22 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 3 Oct 2018 16:09:58 +0000 (18:09 +0200)
commit0f3835878dfa5c2bb280a5f8e8935270508b471a
treee66f05f7f963525e6a9bf37950c3a92655e9784c
parent33dd4ef81245bb868b22f99b9be45d0791131eec
BUG/MEDIUM: h2: check that the connection is still valid at the end of init()

Since commit 7505f94f9 ("MEDIUM: h2: Don't use a wake() method anymore."),
the H2 mux's init() calls h2_process(). But this last one may detect an
early error and call h2_release(), destroying the connection, and return
-1. At this point we're screwed because the caller will still dereference
the connection for various things ranging from the configuration of the
proxy protocol header to the retries. We could simply return -1 here upon
failure but that's not enough since the stream layer really needs to keep
its connection structure allocated (to clean it up in session_kill_embryonic
or for example because it holds the destination address to reconnect to
when the connection goes to the backend). Thus the correct solution here is
to only schedule a wakeup of the I/O callback so that the init succeeds,
and that the connection is only handled later.

No backport is needed, this is 1.9-specific.
src/mux_h2.c