]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: session: Emit an HTTP error if accept fails only for H1 connection
authorChristopher Faulet <cfaulet@haproxy.com>
Wed, 17 Jul 2019 14:53:19 +0000 (16:53 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Fri, 19 Jul 2019 07:46:23 +0000 (09:46 +0200)
commit76f4c370f149149c07bf1f88ae10c33c36c458a0
tree227d8ce3799b5fddb767466c8c99072a63e01330
parentf734638976bde45e96a833a6da32adea2d3a1d15
BUG/MINOR: session: Emit an HTTP error if accept fails only for H1 connection

If session_accept_fd() fails for a raw HTTP socket, we try to send an HTTP error
500. But, we must also take care it is an HTTP/1 connection. We cannot rely on
the mux at this stage, because the error, if any, happens before or during its
creation. So, instead, we check if the mux_proto is specified or not. Indeed,
the mux h1 cannot be forced on the bind line and there is no ALPN to choose
another mux on a raw socket. So if there is no mux_proto defined for a raw HTTP
socket, we are sure to have an HTTP/1 connection.

This patch must be backported to 2.0 and 1.9.
src/session.c