]> git.kaiwu.me - haproxy.git/commit
BUG: http: do not print garbage on invalid requests in debug mode
authorWilly Tarreau <w@1wt.eu>
Mon, 24 Sep 2012 19:13:39 +0000 (21:13 +0200)
committerWilly Tarreau <w@1wt.eu>
Mon, 24 Sep 2012 19:16:42 +0000 (21:16 +0200)
commite92693af2690e735d429d723c1dbc300c7a48637
tree1b19ef6669bfb13e9d33673a0388ed7d721d93c8
parent3aaba440a20b711b7edb696abad389ce2205dfaf
BUG: http: do not print garbage on invalid requests in debug mode

Cyril Bonté reported a mangled debug output when an invalid request
was sent with a faulty request line. The reason was the use of the
msg->sl.rq.l offset which was not yet initialized in this case. So
we change the way to report such an error so that first we initialize
it to zero before parsing a message, then we use that to know whether
we can trust it or not. If it's still zero, then we display the whole
buffer, truncated by debug_hdr() to the first CR or LF character, which
results in the first line only.

The same operation was performed for the response, which was wrong too.
src/proto_http.c