]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: ncbuf: optimize storage for the last gap
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Wed, 4 May 2022 14:16:39 +0000 (16:16 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 12 May 2022 16:18:47 +0000 (18:18 +0200)
commitedeb0a61a264111f48d98113f4860fd23fc88fe1
tree4cf33676143d59f47b4764941989b793e8298414
parentd5d2ed90f030bc15c834852f5bc42f827f636741
MINOR: ncbuf: optimize storage for the last gap

Relax the constraint for gap storage when this is the last block.
ncb_blk API functions will consider that if a gap is stored near the end
of the buffer, without the space to store its header, the gap will cover
entirely the buffer end.

For these special cases, the gap size/data size are not write/read
inside the gap to prevent an overflow. Such a gap is designed in
functions as "reduced gap" and will be flagged with the value
NCB_BK_F_FIN.

This should reduce the rejection on future add operation when receiving
data in-order. Without reduced gap handling, an insertion would be
rejected if it covers only partially the last buffer bytes, which can be
a very common case.
include/haproxy/ncbuf-t.h
src/ncbuf.c