haproxy/include/types
Willy Tarreau 10e61cbf41 BUG/MINOR: http: report real parser state in error captures
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.
2017-01-05 19:48:50 +01:00
..
acl.h
action.h MEDIUM: tcp: add registration and processing of TCP L5 rules 2016-10-21 18:19:24 +02:00
applet.h MINOR: appctx/cli: remove the "tlskeys" entry from the appctx union 2016-12-16 19:40:14 +01:00
arg.h MINOR: http/conf: store the use_backend configuration file and line for logs 2016-11-25 07:15:09 +01:00
auth.h
backend.h
capture.h
channel.h BUG/MAJOR: channel: Fix the definition order of channel analyzers 2017-01-05 17:58:22 +01:00
checks.h MAJOR: check: find out which port to use for health check at run time 2016-09-11 08:12:13 +02:00
cli.h CLEANUP: cli: rename STAT_CLI_* to CLI_ST_* 2016-11-24 16:59:28 +01:00
compression.h MAJOR: filters/http: Rewrite the HTTP compression as a filter 2016-02-09 14:53:15 +01:00
connection.h MINOR: connection: add new prepare_srv()/destroy_srv() entries to xprt_ops 2016-12-22 23:26:38 +01:00
counters.h CLEANUP: counters: move from 3 types to 2 types 2016-11-25 15:03:12 +01:00
dns.h MINOR: dns: implement extra 'hold' timers. 2016-11-09 15:30:47 +01:00
fd.h DEBUG: connection: mark the closed FDs with a value that is easier to detect 2016-11-18 15:00:42 +01:00
filters.h MINOR: filters: Add check_timeouts callback to handle timers expiration on streams 2016-11-21 15:29:58 +01:00
freq_ctr.h
global.h CLEANUP: ssl: move most ssl-specific global settings to ssl_sock.c 2016-12-22 23:26:38 +01:00
hdr_idx.h
hlua.h BUG/MEDIUM: lua: In some case, the return of sample-fetches is ignored (2) 2016-12-14 12:52:47 +01:00
lb_chash.h MINOR: backend: add hash-balance-factor option for hash-type consistent 2016-10-25 20:21:32 +02:00
lb_fas.h
lb_fwlc.h
lb_fwrr.h
lb_map.h
listener.h MEDIUM: move listener->frontend to bind_conf->frontend 2016-12-22 23:26:38 +01:00
log.h CLEANUP: logs: remove unused log format field definitions 2016-08-23 15:25:28 +02:00
mailers.h MINOR: mailers: make it possible to configure the connection timeout 2016-02-20 15:33:06 +01:00
map.h CLEANUP: map: it seems that the map were planed to be chained 2016-03-30 15:41:15 +02:00
obj_type.h
pattern.h MINOR: map: Add regex matching replacement 2016-02-10 23:38:34 +01:00
peers.h MINOR: peers: remove the pointer to the stream 2016-10-31 20:07:01 +01:00
pipe.h
port_range.h
proto_http.h BUG/MINOR: http: report real parser state in error captures 2017-01-05 19:48:50 +01:00
proto_udp.h
protocol.h CLEANUP: fix inconsistency between fd->iocb, proto->accept and accept() 2016-04-14 11:18:22 +02:00
proxy.h CLEANUP: counters: move from 3 types to 2 types 2016-11-25 15:03:12 +01:00
queue.h
sample.h BUG/MEDIUM: samples: make smp_dup() always duplicate the sample 2016-08-09 14:03:23 +02:00
server.h MINOR: server: move the use_ssl field out of the ifdef USE_OPENSSL 2016-12-22 23:26:38 +01:00
session.h
signal.h
ssl_sock.h
stats.h REORG: cli: move "show info" to stats.c 2016-11-24 16:59:27 +01:00
stick_table.h MEDIUM: http: implement http-response track-sc* directive 2016-07-26 14:31:14 +02:00
stream_interface.h
stream.h MEDIUM: lua: remove Lua struct from session, and allocate it with memory pools 2016-12-21 15:24:56 +01:00
task.h
template.h
vars.h MEDIUM: vars: Add a per-process scope for variables 2016-11-09 22:57:00 +01:00