]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: ring: add a new mechanism for retrieving/storing ring data in buffers
authorWilly Tarreau <w@1wt.eu>
Thu, 8 Aug 2019 13:28:52 +0000 (15:28 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 27 Aug 2019 15:14:19 +0000 (17:14 +0200)
commit172945fbada0d1df21fbf9f65162a23c766cb83e
tree4e51d371e80d92dc6c1051fabee9d706d2e6dff2
parenta1426de5aaaef17f310fe3ccf9e062f594fef88a
MINOR: ring: add a new mechanism for retrieving/storing ring data in buffers

Our circular buffers are well suited for being used as ring buffers for
not-so-structured data. The machanism here consists in making room in a
buffer before inserting a new record which is prefixed by its size, and
looking up next record based on the previous one's offset and size. We
can have up to 255 consumers watching for data (dump in progress, tail)
which guarantee that entrees are not recycled while they're being dumped.
The complete representation is described in the header file. For now only
ring_new(), ring_resize() and ring_free() are created.
Makefile
include/proto/ring.h [new file with mode: 0644]
include/types/ring.h [new file with mode: 0644]
src/ring.c [new file with mode: 0644]