]> git.ipfire.org Git - thirdparty/haproxy.git/commit
[MINOR] buffer_replace2 must never change the ->w entry
authorWilly Tarreau <w@1wt.eu>
Mon, 25 Jan 2010 00:49:57 +0000 (01:49 +0100)
committerWilly Tarreau <w@1wt.eu>
Thu, 28 Jan 2010 22:16:58 +0000 (23:16 +0100)
commitc65cbb70953fef330a780ff604c55468514dbf37
treef647a617e3abe11b49cf16c60d232b1cb4770cba
parent857d0c3d0ce6837571b26998572d94b72c9d8ebf
[MINOR] buffer_replace2 must never change the ->w entry

This function is used to move data which is located between ->w and ->r,
so it must not touch ->w, otherwise it will displace pending data which
is before the one we're actually overwriting. The issue arose in 1.4 with
some pipelined responses which cause some part of the previous one to
be chopped off when removing the connection: close header, thus
corrupting last response and shifting next one. Those are detected
in the logs because the next response will be a 502 with flags PH.

Note that this does not affect 1.3, still this is a bug that's better
fixed than blindly copy-pasted and woken up again.

(cherry picked from commit bbfa7938bd74adbfa435f26503fc10f5938195a3)
src/buffers.c