haproxy/include/common
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
..
accept4.h CLEANUP: build: rename some build macros to use the USE_* ones 2019-05-22 19:47:57 +02:00
base64.h
buf.h MINOR: buffer: add a new buffer ring API to manipulate rings of buffers 2019-05-26 09:26:59 +02:00
buffer.h MEDIUM: buffers: relax the buffer lock a little bit 2019-05-28 17:25:21 +02:00
cfgparse.h
chunk.h BUILD: chunk: properly declare pool_head_trash as extern 2019-03-29 21:03:20 +01:00
compat.h BUILD: signals: FreeBSD has SI_LWP instead of SI_TKILL 2019-05-23 08:40:50 +02:00
compiler.h
config.h
debug.h CLEANUP: debug: remove the TRACE() macro 2019-05-26 09:25:59 +02:00
defaults.h MINOR: config: continue to rely on DEFAULT_MAXCONN to set the minimum maxconn 2019-03-13 10:10:49 +01:00
epoll.h CLEANUP: build: rename some build macros to use the USE_* ones 2019-05-22 19:47:57 +02:00
errors.h
h1.h BUG/MEDIUM: h1: Don't parse chunks CRLF if not enough data are available 2019-04-19 15:53:23 +02:00
h2.h
hash.h BUILD: use inttypes.h instead of stdint.h 2019-04-01 07:44:56 +02:00
hathreads.h MEDIUM: threads: add thread_sync_release() to synchronize steps 2019-06-10 09:42:43 +02:00
hpack-dec.h BUILD: use inttypes.h instead of stdint.h 2019-04-01 07:44:56 +02:00
hpack-enc.h BUILD: use inttypes.h instead of stdint.h 2019-04-01 07:44:56 +02:00
hpack-huff.h BUILD: use inttypes.h instead of stdint.h 2019-04-01 07:44:56 +02:00
hpack-tbl.h BUILD: use inttypes.h instead of stdint.h 2019-04-01 07:44:56 +02:00
http-hdr.h BUILD: use inttypes.h instead of stdint.h 2019-04-01 07:44:56 +02:00
http.h BUILD: do not specify "const" on functions returning structs or scalars 2019-04-15 21:55:48 +02:00
htx.h MAJOR: htx: Rework how free rooms are tracked in an HTX message 2019-06-11 14:05:25 +02:00
initcall.h MINOR: initcall: Don't forget to define the __start/stop_init_##stg symbols. 2019-04-10 16:33:25 +02:00
ist.h BUILD: ist: turn the lower/upper case tables to literal on obsolete linkers 2019-05-15 16:14:04 +02:00
istbuf.h BUILD: use inttypes.h instead of stdint.h 2019-04-01 07:44:56 +02:00
memory.h BUILD: threads: fix again the __ha_cas_dw() definition 2019-05-11 18:13:29 +02:00
mini-clist.h MINOR: lists: add LIST_ADDED() to check if an element belongs to a list 2019-05-13 19:14:52 +02:00
namespace.h CLEANUP: build: rename some build macros to use the USE_* ones 2019-05-22 19:47:57 +02:00
net_helper.h
openssl-compat.h CLEANUP: ssl: move all BIO_* definitions to openssl-compat 2019-05-11 17:39:08 +02:00
regex.h MEDIUM: regex: modify regex_comp() to atomically allocate/free the my_regex struct 2019-05-07 06:58:15 +02:00
splice.h CLEANUP: build: rename some build macros to use the USE_* ones 2019-05-22 19:47:57 +02:00
standard.h MEDIUM: tools: improve time format error detection 2019-06-07 19:32:02 +02:00
syscall.h
template.h
ticks.h
time.h CLEANUP: time: refine the test on _POSIX_TIMERS 2019-05-21 20:03:03 +02:00
tools.h
uri_auth.h
version.h
xref.h MEDIUM: xref: Use the new _HA_ATOMIC_* macros. 2019-03-11 17:02:37 +01:00