mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2025-01-04 19:19:33 +00:00
d7884d3449
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. |
||
---|---|---|
.. | ||
accept4.h | ||
base64.h | ||
buf.h | ||
buffer.h | ||
cfgparse.h | ||
chunk.h | ||
compat.h | ||
compiler.h | ||
config.h | ||
debug.h | ||
defaults.h | ||
epoll.h | ||
errors.h | ||
h1.h | ||
h2.h | ||
hash.h | ||
hathreads.h | ||
hpack-dec.h | ||
hpack-enc.h | ||
hpack-huff.h | ||
hpack-tbl.h | ||
http-hdr.h | ||
http.h | ||
htx.h | ||
initcall.h | ||
ist.h | ||
istbuf.h | ||
memory.h | ||
mini-clist.h | ||
namespace.h | ||
net_helper.h | ||
openssl-compat.h | ||
regex.h | ||
splice.h | ||
standard.h | ||
syscall.h | ||
template.h | ||
ticks.h | ||
time.h | ||
tools.h | ||
uri_auth.h | ||
version.h | ||
xref.h |