]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MEDIUM: http: don't start to forward request data before the connect
authorWilly Tarreau <w@1wt.eu>
Wed, 12 Mar 2014 09:41:13 +0000 (10:41 +0100)
committerWilly Tarreau <w@1wt.eu>
Fri, 14 Mar 2014 11:22:56 +0000 (12:22 +0100)
commit80a92c02f478dc1b836e0c97c891875437fc54da
tree2711f9a7456cb96d2e54280180fedafb98dcaa84
parentda5d4a5560b33d0fc6cfeca684190fdf8e4602e9
BUG/MEDIUM: http: don't start to forward request data before the connect

Currently, "balance url_param check_post" randomly works. If the client
sends chunked data and there's another chunk after the one containing the
data, http_request_forward_body() will advance msg->sov and move the start
of data to the beginning of the last chunk, and get_server_ph_post() will
not find the data.

In order to avoid this, we add an HTTP_MSGF_WAIT_CONN flag whose goal is
to prevent the forwarding code from parsing until the connection is
confirmed, so that we're certain not to fail on a redispatch. Note that
we need to force channel_auto_connect() since the output buffer is empty
and a previous analyser might have stopped auto-connect.

The flag is currently set whenever some L7 POST analysis is needed for a
connect() so that it correctly addresses all corner cases involving a
possible rewind of the buffer, waiting for a better fix.

Note that this has been broken for a very long time. Even all 1.4 versions
seem broken but differently, with ->sov pointing to the end of the arguments.
So the fix should be considered for backporting to all stable releases,
possibly including 1.3 which works differently.
include/types/proto_http.h
src/proto_http.c
src/proxy.c