haproxy/src
Willy Tarreau 347f464d4e BUG/MEDIUM: mux-h1: do not truncate trailing 0CRLF on buffer boundary
The H1 message parser calls the various message block parsers with an
offset indicating where in the buffer to start from, and only consumes
the data at the end of the parsing. The headers and trailers parsers
have a condition detecting if a headers or trailers block is too large
to fit into the buffer. This is detected by an incomplete block while
the buffer is full. Unfortunately it doesn't take into account the fact
that the block may be parsed after other blocks that are still present
in the buffer, resulting in aborting some transfers early as reported
in issue #231. This typically happens if a trailers block is incomplete
at the end of a buffer full of data, which typically happens with data
sizes multiple of the buffer size minus less than the trailers block
size. It also happens with the CRLF that follows the 0-sized chunk of
any transfer-encoded contents is itself on such a boundary since this
CRLF is technically part of the trailers block. This can be reproduced
by asking a server to retrieve exactly 31532 or 31533 bytes of static
data using chunked encoding with curl, which reports:

   transfer closed with outstanding read data remaining

This issue was revealed in 2.0 and does not affect 1.9 because in 1.9
the trailers block was processed at once as part of the data block
processing, and would simply give up and wait for the rest of the data
to arrive.

It's interesting to note that the headers block parsing is also affected
by this issue but in practice it has a much more limited impact since a
headers block is normally only parsed at the beginning of a buffer. The
only case where it seems to matter is when dealing with a response buffer
full of 100-continue header blocks followed by a regular header block,
which will then be rejected for the same reason.

This fix must be backported to 2.0 and partially to 1.9 (the headers
block part).
2019-08-23 08:11:36 +02:00
..
51d.c REORG: proto_htx: Move HTX analyzers & co to http_ana.{c,h} files 2019-07-19 09:24:12 +02:00
acl.c BUG/MINOR: acl: properly detect pattern type SMP_T_ADDR 2019-04-19 11:45:20 +02:00
action.c BUG/MEDIUM: stick-table: Wrong stick-table backends parsing. 2019-08-07 10:32:31 +02:00
activity.c CLEANUP: cli: replace all occurrences of manual handling of return messages 2019-08-09 11:26:10 +02:00
applet.c MINOR: applet: make appctx use their own pool 2019-07-18 10:45:08 +02:00
arg.c MEDIUM: tools: improve time format error detection 2019-06-07 19:32:02 +02:00
auth.c CLEANUP: build: rename some build macros to use the USE_* ones 2019-05-22 19:47:57 +02:00
backend.c MEDIUM: backend: remove impossible cases from connect_server() 2019-07-19 13:50:09 +02:00
base64.c BUG/MINOR: base64: dec func ignores padding for output size checking 2019-01-14 19:32:15 +01:00
buffer.c MEDIUM: memory: use pool_destroy_all() to destroy all pools on deinit() 2018-11-26 19:50:32 +01:00
cache.c MINOR: cache: allow caching of OPTIONS request 2019-08-07 15:13:38 +02:00
calltrace.c REORG: trace: rename trace.c to calltrace.c and mention it's not thread-safe 2019-08-22 20:21:00 +02:00
cfgparse-global.c BUG/MEDIUM: threads: cpu-map designating a single thread/process are ignored 2019-07-16 15:23:09 +02:00
cfgparse-listen.c MINOR: config: Warn only if the option http-use-htx is used with "no" prefix 2019-07-19 11:39:19 +02:00
cfgparse.c MINOR: proxy: Remove the unused list of block rules 2019-07-19 09:24:12 +02:00
channel.c MINOR: channel: Add the function channel_add_input 2019-01-02 20:12:44 +01:00
checks.c BUG/MEDIUM: checks: make sure to close nicely when we're the last to speak 2019-08-06 16:35:55 +02:00
chunk.c Revert "MINOR: chunks: Make sure trash_size is only set once." 2019-06-07 15:37:47 +02:00
cli.c CLEANUP: cli: replace all occurrences of manual handling of return messages 2019-08-09 11:26:10 +02:00
compression.c MINOR: time: move the cpu, mono, and idle time to thread_info 2019-05-20 21:14:14 +02:00
connection.c MEDIUM: connection: make sure all address producers allocate their address 2019-07-19 13:50:09 +02:00
da.c REORG: proto_htx: Move HTX analyzers & co to http_ana.{c,h} files 2019-07-19 09:24:12 +02:00
debug.c MEDIUM: debug: make the thread dump code show Lua backtraces 2019-08-21 14:32:09 +02:00
dict.c BUG/MINOR: dict: race condition fix when inserting dictionary entries. 2019-06-11 09:54:12 +02:00
dns.c CLEANUP: cli: replace all occurrences of manual handling of return messages 2019-08-09 11:26:10 +02:00
ev_epoll.c MEDIUM: pollers: Remember the state for read and write for each threads. 2019-07-31 14:54:41 +02:00
ev_evports.c MEDIUM: pollers: Remember the state for read and write for each threads. 2019-07-31 14:54:41 +02:00
ev_kqueue.c MEDIUM: pollers: Remember the state for read and write for each threads. 2019-07-31 14:54:41 +02:00
ev_poll.c MEDIUM: pollers: Remember the state for read and write for each threads. 2019-07-31 14:54:41 +02:00
ev_select.c BUG/MEDIUM: pollers: Clear the poll_send bits as well. 2019-08-05 23:56:26 +02:00
fd.c BUG/MEDIUM: fd: Always reset the polled_mask bits in fd_dodelete(). 2019-08-05 18:55:04 +02:00
filters.c REORG: proto_htx: Move HTX analyzers & co to http_ana.{c,h} files 2019-07-19 09:24:12 +02:00
flt_http_comp.c REORG: proto_htx: Move HTX analyzers & co to http_ana.{c,h} files 2019-07-19 09:24:12 +02:00
flt_spoe.c REORG: proto_htx: Move HTX analyzers & co to http_ana.{c,h} files 2019-07-19 09:24:12 +02:00
flt_trace.c REORG: proto_htx: Move HTX analyzers & co to http_ana.{c,h} files 2019-07-19 09:24:12 +02:00
freq_ctr.c BUG/MAJOR: threads/freq_ctr: use a memory barrier to detect changes 2017-10-31 18:01:18 +01:00
frontend.c MINOR: frontend: switch from conn->addr.{from,to} to conn->{src,dst} 2019-07-19 13:50:09 +02:00
h1.c MAJOR: http: Remove the HTTP legacy code 2019-07-19 09:24:12 +02:00
h2.c CLEANUP: h2: Remove functions converting h2 requests to raw HTTP/1.1 ones 2019-07-19 09:18:27 +02:00
haproxy.c MAJOR: fd: Get rid of the fd cache. 2019-07-31 14:12:55 +02:00
hash.c MINOR: hash: add new function hash_crc32c 2018-03-21 05:04:01 +01:00
hathreads.c MEDIUM: threads: add thread_sync_release() to synchronize steps 2019-06-10 09:42:43 +02:00
hlua.c MINOR: lua: export applet and task handlers 2019-08-21 14:32:09 +02:00
hlua_fcn.c MEDIUM: regex: modify regex_comp() to atomically allocate/free the my_regex struct 2019-05-07 06:58:15 +02:00
hpack-dec.c BUILD: use inttypes.h instead of stdint.h 2019-04-01 07:44:56 +02:00
hpack-enc.c BUILD: use inttypes.h instead of stdint.h 2019-04-01 07:44:56 +02:00
hpack-huff.c BUILD: use inttypes.h instead of stdint.h 2019-04-01 07:44:56 +02:00
hpack-tbl.c BUILD: use inttypes.h instead of stdint.h 2019-04-01 07:44:56 +02:00
http.c MINOR: http: Don't store raw HTTP errors in chunks anymore 2019-07-19 09:46:23 +02:00
http_acl.c MEDIUM: init: convert all trivial registration calls to initcalls 2018-11-26 19:50:32 +01:00
http_act.c REORG: proto_htx: Move HTX analyzers & co to http_ana.{c,h} files 2019-07-19 09:24:12 +02:00
http_ana.c BUG/MINOR: stats: Wait the body before processing POST requests 2019-08-15 22:26:50 +02:00
http_conv.c MEDIUM: init: convert all trivial registration calls to initcalls 2018-11-26 19:50:32 +01:00
http_fetch.c BUG/MAJOR: http/sample: use a static buffer for raw -> htx conversion 2019-08-01 11:35:29 +02:00
http_htx.c BUG/MINOR: http_htx: Support empty errorfiles 2019-07-23 14:58:32 +02:00
http_rules.c REORG: proto_htx: Move HTX analyzers & co to http_ana.{c,h} files 2019-07-19 09:24:12 +02:00
htx.c BUG/MINOR: htx: Fix free space addresses calculation during a block expansion 2019-07-29 11:17:52 +02:00
i386-linux-vsys.c MEDIUM: listener: add support for linux's accept4() syscall 2012-10-08 20:11:03 +02:00
lb_chash.c BUG/MEDIUM: lb-chash: Ensure the tree integrity when server weight is increased 2019-08-01 11:35:29 +02:00
lb_fas.c BUG/MEDIUM: lb_fas: Don't test the server's lb_tree from outside the lock 2019-07-05 14:26:15 +02:00
lb_fwlc.c BUG/MEDIUM: lb_fwlc: Don't test the server's lb_tree from outside the lock 2019-06-19 13:55:57 +02:00
lb_fwrr.c BUG/MAJOR: lb/threads: make sure the avoided server is not full on second pass 2019-05-27 10:29:59 +02:00
lb_map.c MEDIUM: lb/threads: Use the new _HA_ATOMIC_* macros. 2019-03-11 17:02:38 +01:00
listener.c BUG/MEDIUM: protocols: add a global lock for the init/deinit stuff 2019-07-24 16:45:02 +02:00
log.c BUG/MINOR: log: make sure writev() is not interrupted on a file output 2019-07-26 15:46:18 +02:00
lru.c MINOR: lru: new function to delete <nb> least recently used keys 2016-01-11 07:31:35 +01:00
mailers.c MEDIUM: Add parsing of mailers section 2015-02-03 00:24:16 +01:00
map.c CLEANUP: cli: replace all occurrences of manual handling of return messages 2019-08-09 11:26:10 +02:00
memory.c MINOR: pools: always pre-initialize allocated memory outside of the lock 2019-07-09 10:40:33 +02:00
mux_h1.c BUG/MEDIUM: mux-h1: do not truncate trailing 0CRLF on buffer boundary 2019-08-23 08:11:36 +02:00
mux_h2.c CLEANUP: mux-h2: move the demuxed frame check code in its own function 2019-08-07 14:25:20 +02:00
mux_pt.c BUG/MEDIUM: mux_pt: Don't call unsubscribe if we did not subscribe. 2019-08-16 16:11:56 +02:00
mworker-prog.c MEDIUM: mworker-prog: Add user/group options to program section 2019-07-15 16:43:16 +02:00
mworker.c BUILD: mworker: silence two printf format warnings around getpid() 2019-06-22 07:57:56 +02:00
namespace.c MINOR: initcall: apply initcall to all register_build_opts() calls 2018-11-26 19:50:32 +01:00
pattern.c BUILD: pattern: work around an internal compiler bug in gcc-3.4 2019-06-16 18:40:33 +02:00
payload.c REORG: proto_htx: Move HTX analyzers & co to http_ana.{c,h} files 2019-07-19 09:24:12 +02:00
peers.c CLEANUP: cli: replace all occurrences of manual handling of return messages 2019-08-09 11:26:10 +02:00
pipe.c BUILD: address a few cases of "static <type> inline foo()" 2019-04-15 21:55:48 +02:00
proto_sockpair.c BUG/MEDIUM: protocols: add a global lock for the init/deinit stuff 2019-07-24 16:45:02 +02:00
proto_tcp.c BUG/MEDIUM: protocols: add a global lock for the init/deinit stuff 2019-07-24 16:45:02 +02:00
proto_udp.c CLEANUP: fix inconsistency between fd->iocb, proto->accept and accept() 2016-04-14 11:18:22 +02:00
proto_uxst.c BUG/MEDIUM: protocols: add a global lock for the init/deinit stuff 2019-07-24 16:45:02 +02:00
protocol.c BUG/MEDIUM: protocols: add a global lock for the init/deinit stuff 2019-07-24 16:45:02 +02:00
proxy.c BUG/MEDIUM: proxy: Don't use cs_destroy() when freeing the conn_stream. 2019-08-09 18:01:15 +02:00
queue.c BUG/MAJOR: queue/threads: avoid an AB/BA locking issue in process_srv_queue() 2019-07-30 14:02:06 +02:00
raw_sock.c MEDIUM: connections: Remove CONN_FL_SOCK* 2019-06-05 18:03:38 +02:00
regex.c MEDIUM: regex: modify regex_comp() to atomically allocate/free the my_regex struct 2019-05-07 06:58:15 +02:00
sample.c BUG/MEDIUM: stick-table: Wrong stick-table backends parsing. 2019-08-07 10:32:31 +02:00
server.c CLEANUP: cli: replace all occurrences of manual handling of return messages 2019-08-09 11:26:10 +02:00
session.c MAJOR: fd: Get rid of the fd cache. 2019-07-31 14:12:55 +02:00
sha1.c BUILD: use inttypes.h instead of stdint.h 2019-04-01 07:44:56 +02:00
shctx.c CLEANUP: Fix typos in the shctx subsystem 2018-12-02 18:40:29 +01:00
signal.c CLEANUP: Fix a typo in the signal subsystem 2018-12-02 18:39:52 +01:00
sink.c MINOR: sink: add a support for file descriptors 2019-08-22 20:21:00 +02:00
ssl_sock.c CLEANUP: cli: replace all occurrences of manual handling of return messages 2019-08-09 11:26:10 +02:00
standard.c MINOR: tools: add append_prefixed_str() 2019-08-21 14:32:09 +02:00
stats.c CLEANUP: cli: replace all occurrences of manual handling of return messages 2019-08-09 11:26:10 +02:00
stick_table.c CLEANUP: cli: replace all occurrences of manual handling of return messages 2019-08-09 11:26:10 +02:00
stream.c CLEANUP: cli: replace all occurrences of manual handling of return messages 2019-08-09 11:26:10 +02:00
stream_interface.c BUG/MINOR: stream-int: also update analysers timeouts on activity 2019-08-01 18:58:21 +02:00
task.c MINOR: task: introduce work lists 2019-07-12 09:07:48 +02:00
tcp_rules.c MAJOR: http: Remove the HTTP legacy code 2019-07-19 09:24:12 +02:00
time.c BUG/MINOR: time: make sure only one thread sets global_now at boot 2019-06-06 16:50:39 +02:00
trace.c MINOR: trace: retrieve useful pointers and enforce lock-on 2019-08-22 20:21:00 +02:00
uri_auth.c CLEANUP: log: Rename Alert/Warning in ha_alert/ha_warning 2017-11-24 17:19:12 +01:00
vars.c REORG: proto_htx: Move HTX analyzers & co to http_ana.{c,h} files 2019-07-19 09:24:12 +02:00
version.c BUILD: add a new file "version.c" to carry version updates 2019-01-04 18:20:32 +01:00
wdt.c MINOR: wdt: also consider that waiting in the thread dumper is normal 2019-07-31 19:35:31 +02:00
wurfl.c REORG: proto_htx: Move HTX analyzers & co to http_ana.{c,h} files 2019-07-19 09:24:12 +02:00
xprt_handshake.c CLEANUP: connection: rename the wait_event.task field to .tasklet 2019-06-14 14:42:29 +02:00
xxhash.c BUILD: use inttypes.h instead of stdint.h 2019-04-01 07:44:56 +02:00