]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: ncbuf: implement insertion
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Mon, 9 May 2022 07:43:11 +0000 (09:43 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 12 May 2022 16:27:05 +0000 (18:27 +0200)
commit077e096b30095924e7706ffdfbe301827a7ccdb6
tree9cdd3cb666877f0d37885577fddd5be450abbd53
parentedeb0a61a264111f48d98113f4860fd23fc88fe1
MINOR: ncbuf: implement insertion

Implement a new function ncb_add() to insert data in ncbuf. This
operation is conducted in two stages. First, a simulation will be run to
ensure that insertion can be proceeded. If a gap is formed, either
before or after the new data, it must be big enough to store its header,
or else the insertion is aborted.

After this check stage, the insertion is conducted block by block with
the function pair ncb_fill_data_blk()/ncb_fill_gap_blk().

A new type ncb_ret is used as a return value. For the moment, only
success or gap-size error is used. It is planned to add new error types
in the future when insertion will be extended.
include/haproxy/ncbuf-t.h
include/haproxy/ncbuf.h
src/ncbuf.c