mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2025-03-03 10:01:27 +00:00
Error captures almost always report a state 26 (MSG_ERROR) making it very hard to know what the parser was expecting. The reason is that we have to switch to MSG_ERROR to trigger the dump, and then during the dump we capture the current state which is already MSG_ERROR. With this change we now copy the current state into an err_state field that will be reported as the faulty state. This patch looks a bit large because the parser doesn't update the current state until it runs out of data so the current state is never known when jumping to ther error label! Thus the code had to be updated to take copies of the current state before switching to MSG_ERROR based on the switch/case values. As a bonus, it now shows the current state in human-readable form and not only in numeric form ; in the past it was not an issue since it was always 26 (MSG_ERROR). At least now we can get exploitable invalid request/response reports : [05/Jan/2017:19:28:57.095] frontend f (#2): invalid request backend <NONE> (#-1), server <NONE> (#-1), event #1 src 127.0.0.1:39894, session #4, session flags 0x00000080 HTTP msg state MSG_RQURI(4), msg flags 0x00000000, tx flags 0x00000000 HTTP chunk len 0 bytes, HTTP body len 0 bytes buffer flags 0x00908002, out 0 bytes, total 20 bytes pending 20 bytes, wrapping at 16384, error at position 5: 00000 GET /\e HTTP/1.0\r\n 00017 \r\n 00019 \n [05/Jan/2017:19:28:33.827] backend b (#3): invalid response frontend f (#2), server s1 (#1), event #0 src 127.0.0.1:39718, session #0, session flags 0x000004ce HTTP msg state MSG_HDR_NAME(17), msg flags 0x00000000, tx flags 0x08300000 HTTP chunk len 0 bytes, HTTP body len 0 bytes buffer flags 0x80008002, out 0 bytes, total 59 bytes pending 59 bytes, wrapping at 16384, error at position 31: 00000 HTTP/1.1 200 OK\r\n 00017 Content-length : 10\r\n 00038 \r\n 00040 0a\r\n 00044 0123456789\r\n 00056 0\r\n This should be backported to 1.7 and 1.6 at least to help with bug reports. |
||
---|---|---|
.. | ||
acl.h | ||
action.h | ||
applet.h | ||
arg.h | ||
auth.h | ||
backend.h | ||
capture.h | ||
channel.h | ||
checks.h | ||
cli.h | ||
compression.h | ||
connection.h | ||
counters.h | ||
dns.h | ||
fd.h | ||
filters.h | ||
freq_ctr.h | ||
global.h | ||
hdr_idx.h | ||
hlua.h | ||
lb_chash.h | ||
lb_fas.h | ||
lb_fwlc.h | ||
lb_fwrr.h | ||
lb_map.h | ||
listener.h | ||
log.h | ||
mailers.h | ||
map.h | ||
obj_type.h | ||
pattern.h | ||
peers.h | ||
pipe.h | ||
port_range.h | ||
proto_http.h | ||
proto_udp.h | ||
protocol.h | ||
proxy.h | ||
queue.h | ||
sample.h | ||
server.h | ||
session.h | ||
signal.h | ||
ssl_sock.h | ||
stats.h | ||
stick_table.h | ||
stream_interface.h | ||
stream.h | ||
task.h | ||
template.h | ||
vars.h |