haproxy/src
Christopher Faulet d7884d3449 MAJOR: htx: Rework how free rooms are tracked in an HTX message
In an HTX message, it may have 2 available rooms to store a new block. The first
one is between the blocks and their payload. Blocks are added starting from the
end of the buffer and their payloads are added starting from the begining. So
the first free room is between these 2 edges. The second one is at the begining
of the buffer, when we start to wrap to add new payloads. Once we start to use
this one, the other one is ignored until the next defragmentation of the HTX
message.

In theory, there is no problem. But in practice, some lacks in the HTX structure
force us to defragment too often HTX messages to always be in a known state. The
second free room is not tracked as it should do and the first one may be easily
corrupted when rewrites happen.

So to fix the problem and avoid unecessary defragmentation, the HTX structure
has been refactored. The front (the block's position of the first payload before
the blocks) is no more stored. Instead we keep the relative addresses of 3 edges:

 * tail_addr : The start address of the free space in front of the the blocks
               table
 * head_addr : The start address of the free space at the beginning
 * end_addr  : The end address of the free space at the beginning

Here is the general view of the HTX message now:

           head_addr     end_addr    tail_addr
               |            |            |
               V            V            V
  +------------+------------+------------+------------+------------------+
  |            |            |            |            |                  |
  |  PAYLOAD   | Free space |  PAYLOAD   | Free space |    Blocks area   |
  |    ==>     |     1      |    ==>     |     2      |        <==       |
  +------------+------------+------------+------------+------------------+

<head_addr> is always lower or equal to <end_addr> and <tail_addr>. <end_addr>
is always lower or equal to <tail_addr>.

In addition;, to simplify everything, the blocks area are now contiguous. It
doesn't wrap anymore. So the head is always the block with the lowest position,
and the tail is always the one with the highest position.
2019-06-11 14:05:25 +02:00
..
51d.c BUG/MINOR: 51d: Get the request channel to call CHECK_HTTP_MESSAGE_FIRST() 2019-04-19 15:53:23 +02:00
acl.c BUG/MINOR: acl: properly detect pattern type SMP_T_ADDR 2019-04-19 11:45:20 +02:00
action.c MINOR: stick-tables: Add peers process binding computing. 2019-05-07 06:54:07 +02:00
activity.c MINOR: activity: enable automatic profiling turn on/off 2019-04-25 17:26:46 +02:00
applet.c MEDIUM: appctx/debug: force a crash if an appctx spins over itself forever 2019-04-26 13:15:56 +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: connections: Introduce a handshake pseudo-XPRT. 2019-06-05 18:03:38 +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 BUG/MINOR: cache/htx: Fix the counting of data already sent by the cache applet 2019-06-11 14:05:25 +02:00
cfgparse-global.c MEDIUM: tools: improve time format error detection 2019-06-07 19:32:02 +02:00
cfgparse-listen.c MEDIUM: tools: improve time format error detection 2019-06-07 19:32:02 +02:00
cfgparse.c MEDIUM: tools: improve time format error detection 2019-06-07 19:32:02 +02:00
channel.c MINOR: channel: Add the function channel_add_input 2019-01-02 20:12:44 +01:00
checks.c MEDIUM: connections: Introduce a handshake pseudo-XPRT. 2019-06-05 18:03:38 +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 MEDIUM: tools: improve time format error detection 2019-06-07 19:32:02 +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: connections: Remove CONN_FL_SOCK* 2019-06-05 18:03:38 +02:00
da.c MEDIUM: http/htx: Perform analysis relatively to the first block 2019-05-28 07:42:12 +02:00
debug.c MEDIUM: tasks: Get rid of active_tasks_mask. 2019-05-29 21:53:37 +02:00
dict.c BUG/MINOR: dict: race condition fix when inserting dictionary entries. 2019-06-11 09:54:12 +02:00
dns.c MINOR: action: new '(http-request|tcp-request content) do-resolve' action 2019-04-23 11:41:52 +02:00
ev_epoll.c MEDIUM: poller: separate the wait time from the wake events 2019-05-28 17:25:21 +02:00
ev_evports.c MEDIUM: poller: separate the wait time from the wake events 2019-05-28 17:25:21 +02:00
ev_kqueue.c MEDIUM: poller: separate the wait time from the wake events 2019-05-28 17:25:21 +02:00
ev_poll.c MEDIUM: poller: separate the wait time from the wake events 2019-05-28 17:25:21 +02:00
ev_select.c MEDIUM: poller: separate the wait time from the wake events 2019-05-28 17:25:21 +02:00
fd.c BUG/MEDIUM: threads: fix double-word CAS on non-optimized 32-bit platforms 2019-05-27 17:40:59 +02:00
filters.c MEDIUM: filters/htx: Filter body relatively to the first block 2019-05-28 07:42:33 +02:00
flt_http_comp.c BUG/MEDIUM: compression/htx: Fix the adding of the last data block 2019-06-11 14:05:25 +02:00
flt_spoe.c MEDIUM: tools: improve time format error detection 2019-06-07 19:32:02 +02:00
flt_trace.c MINOR: flt_trace: Don't scrash the original offset during the random forwarding 2019-06-11 14:05:25 +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 MEDIUM: init: convert all trivial registration calls to initcalls 2018-11-26 19:50:32 +01:00
h1.c MEDIUM: h1: Add an option to sanitize connection headers during parsing 2019-04-12 22:06:53 +02:00
h2.c MEDIUM: htx: Add the parsing of trailers of chunked messages 2019-06-05 10:12:11 +02:00
haproxy.c MEDIUM: init/threads: don't use spinlocks during the init phase 2019-06-11 11:30:26 +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
hdr_idx.c CLEANUP: pools: rename all pool functions and pointers to remove this "2" 2017-11-24 17:49:53 +01:00
hlua.c MEDIUM: tools: improve time format error detection 2019-06-07 19:32:02 +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 BUILD: do not specify "const" on functions returning structs or scalars 2019-04-15 21:55:48 +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 BUG/MEDIUM: http: fix "http-request reject" when not final 2019-05-28 08:26:17 +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 MINOR: htx: Don't use end-of-data blocks anymore 2019-06-05 10:12:11 +02:00
http_htx.c MAJOR: htx: Rework how free rooms are tracked in an HTX message 2019-06-11 14:05:25 +02:00
http_msg.c BUG/MEDIUM: http: Use pointer to the begining of input to parse message headers 2019-05-10 11:47:00 +02:00
http_rules.c MEDIUM: regex: modify regex_comp() to atomically allocate/free the my_regex struct 2019-05-07 06:58:15 +02:00
htx.c MAJOR: htx: Rework how free rooms are tracked in an HTX message 2019-06-11 14:05:25 +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 MINOR: backend: move hash_balance_factor out of chash 2019-01-14 19:33:17 +01:00
lb_fas.c BUG/MEDIUM: lb/threads: always properly lock LB algorithms on maintenance operations 2018-08-21 19:44:53 +02:00
lb_fwlc.c MINOR: lb: make the leastconn algorithm more accurate 2018-12-14 08:33:28 +01: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: listener: Fix how unlimited number of consecutive accepts is handled 2019-04-30 15:28:29 +02:00
log.c MINOR: logs: use the new bitmap functions instead of fd_sets for encoding maps 2019-06-07 11:13:24 +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 BUG/MEDIUM: maps: only try to parse the default value when it's present 2019-04-19 11:35:22 +02:00
memory.c MINOR: activity: report the number of failed pool/buffer allocations 2019-05-28 17:25:21 +02:00
mux_h1.c BUG/MEDIUM: H1: When upgrading, make sure we don't free the buffer too early. 2019-06-07 19:37:21 +02:00
mux_h2.c BUG/MEDIUM: mux-h2: make sure the connection timeout is always set 2019-06-07 08:47:44 +02:00
mux_pt.c CLEANUP: build: rename some build macros to use the USE_* ones 2019-05-22 19:47:57 +02:00
mworker-prog.c BUG/MINOR: mworker: Fix memory leak of mworker_proc members 2019-05-22 11:29:18 +02:00
mworker.c BUG/MINOR: mworker: Fix memory leak of mworker_proc members 2019-05-22 11:29:18 +02:00
namespace.c MINOR: initcall: apply initcall to all register_build_opts() calls 2018-11-26 19:50:32 +01:00
pattern.c MEDIUM: regex: modify regex_comp() to atomically allocate/free the my_regex struct 2019-05-07 06:58:15 +02:00
payload.c MINOR: htx: Remove the macro IS_HTX_SMP() and always use IS_HTX_STRM() instead 2019-05-28 07:42:12 +02:00
peers.c MINOR: peers: Optimization for dictionary cache lookup. 2019-06-07 15:47:54 +02:00
pipe.c BUILD: address a few cases of "static <type> inline foo()" 2019-04-15 21:55:48 +02:00
proto_http.c MEDIUM: sessions: Introduce session flags. 2019-05-29 15:41:47 +02:00
proto_htx.c MINOR: htx: Don't use end-of-data blocks anymore 2019-06-05 10:12:11 +02:00
proto_sockpair.c MEDIUM: connections: Remove CONN_FL_SOCK* 2019-06-05 18:03:38 +02:00
proto_tcp.c MEDIUM: tools: improve time format error detection 2019-06-07 19:32: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 MEDIUM: connections: Remove CONN_FL_SOCK* 2019-06-05 18:03:38 +02:00
protocol.c MEDIUM: protocol: use a custom AF_MAX to help protocol parser 2018-09-12 07:12:27 +02:00
proxy.c MEDIUM: tools: improve time format error detection 2019-06-07 19:32:02 +02:00
queue.c BUG/MEDIUM: queue: fix the tree walk in pendconn_redistribute. 2019-05-27 10:29:59 +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 MEDIUM: regex: modify regex_comp() to atomically allocate/free the my_regex struct 2019-05-07 06:58:15 +02:00
server.c MEDIUM: tools: improve time format error detection 2019-06-07 19:32:02 +02:00
session.c MEDIUM: connections: Introduce a handshake pseudo-XPRT. 2019-06-05 18:03:38 +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
ssl_sock.c MEDIUM: tools: improve time format error detection 2019-06-07 19:32:02 +02:00
standard.c MEDIUM: tools: improve time format error detection 2019-06-07 19:32:02 +02:00
stats.c MINOR: htx: Don't use end-of-data blocks anymore 2019-06-05 10:12:11 +02:00
stick_table.c MEDIUM: tools: improve time format error detection 2019-06-07 19:32:02 +02:00
stream.c MEDIUM: stream: don't abusively loop back on changes on CF_SHUT*_NOW 2019-06-06 16:36:19 +02:00
stream_interface.c BUG/MEDIUM: stream_interface: Make sure we call si_cs_process() if CS_FL_EOI. 2019-06-07 19:37:21 +02:00
task.c BUILD: task: fix a build warning when threads are disabled 2019-06-04 17:18:40 +02:00
tcp_rules.c MEDIUM: tools: improve time format error detection 2019-06-07 19:32:02 +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 CONTRIB: trace: try to display the function's return value on exit 2017-10-24 19:54:25 +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 BUG/MEDIUM: vars: make the tcp/http unset-var() action support conditions 2019-06-04 16:48:15 +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 BUILD: watchdog: condition it to USE_RT 2019-05-23 10:20:55 +02:00
wurfl.c MINOR: WURFL: do not emit warnings when not configured 2019-05-22 14:01:22 +02:00
xprt_handshake.c MEDIUM: connections: Introduce a handshake pseudo-XPRT. 2019-06-05 18:03:38 +02:00
xxhash.c BUILD: use inttypes.h instead of stdint.h 2019-04-01 07:44:56 +02:00