]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: http: Be sure to process all the data received from a server
authorChristopher Faulet <cfaulet@qualys.com>
Fri, 19 Jun 2015 07:00:58 +0000 (09:00 +0200)
committerWilly Tarreau <w@1wt.eu>
Mon, 28 Dec 2015 15:49:36 +0000 (16:49 +0100)
commita46bbd893aa5c52ae8e6e21daad27cbce4bdaa08
tree4c8fa279085eb5a1f8bf9e945da6ba40b57ef453
parentf66258237cc5ea48448836c4296c222b325e5dcb
BUG/MINOR: http: Be sure to process all the data received from a server

When the response body is forwarded, if the server closes the input before the
end, an error is thrown. But if the data processing is too slow, all data could
already be received and pending in the input buffer. So this is a bug to stop
processing in this context. The server doesn't really closed the input before
the end.

As an example, this could happen when HAProxy is configured to do compression
offloading. If the server closes the connection explicitly after the response
(keep-alive disabled by the server) and if HAProxy receives the data faster than
they are compressed, then the response could be truncated.

This patch fixes the bug by checking if some pending data remain in the input
buffer before returning an error. If yes, the processing continues.
src/proto_http.c