]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MEDIUM: http: Close streams for connections closed before a redirect
authorChristopher Faulet <cfaulet@haproxy.com>
Mon, 11 Sep 2017 07:27:29 +0000 (09:27 +0200)
committerWilly Tarreau <w@1wt.eu>
Mon, 11 Sep 2017 15:39:21 +0000 (17:39 +0200)
commit5d468ca97b9437eb12403ce25d71622e508eac5c
treea14d300976600656542bee87a00571dc958fc09d
parentddcde195ebb47a9707e97905501959e39808eb9b
BUG/MEDIUM: http: Close streams for connections closed before a redirect

A previous fix was made to prevent the connection to a server if a redirect was
performed during the request processing when we wait to keep the client
connection alive. This fix introduced a pernicious bug. If a client closes its
connection immediately after sending a request, it is possible to keep stream
alive infinitely. This happens when the connection closure is caught when the
request is received, before the request parsing.

To be more specific, this happens because the close event is not "forwarded",
first because of the call to "channel_dont_connect" in the function
"http_apply_redirect_rule", then because we want to keep the client connection
alive, we explicitly call "channel_dont_close" in the function
"http_request_forward_body".

So, to fix the bug, instead of blocking the server connection, we force its
shutdown. This will force the stream to re-evaluate all connexions states. So it
will detect the client has closed its connection.

This patch must be backported in 1.7.
src/proto_http.c