Hi again,

Le 01/11/2012 12:25, Willy Tarreau a écrit :
On Thu, Nov 01, 2012 at 12:18:04PM +0100, Cyril Bonté wrote:
I'm making some tests, forging requests. I'm observing something weird
with haproxy-1.4 (not with haproxy-1.5).
Using "http-send-name-header Host", in some conditions, it appears that
haproxy sends garbage data (well, everything in the buffer I think). In
my tests, this results in sending 2 requests at a time.

Hmmm indeed since it needs to modify a request that was already scheduled
for forwarding, so it has to play with output data. I would not be surprized
if something goes wrong with post requests where data are already available
in the buffer. Worse, incoming POST data can fill the buffer and prevent
haproxy from rewriting too large a header. I think that I should amend the
documentation to indicate that all server header values must be of the
exact same length to avoid this issue :-/

OK, I could reproduce the issue, which happens as soon as http-send-name-header is applied to a header provided in the request.

I'm sending a patch just after this mail (for haproxy 1.4), but I'm not sure it's the right way to fix it : after headers are removed, I decrease the buf->send_max value with the length of headers removed.

This bug doesn't appear as soon as reqdel is called on the same headers.

--
Cyril Bonté

Reply via email to