]> git.ipfire.org Git - thirdparty/haproxy.git/commit
IMPORT: slz: implement a synchronous flush() operation
authorWilly Tarreau <w@1wt.eu>
Mon, 26 Jun 2023 17:24:55 +0000 (19:24 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 30 Jun 2023 14:12:36 +0000 (16:12 +0200)
commit90d18e2006e9f8177ad2014dbaa83ff1689c642e
tree3780eea18373cee94eec087c3b6af0395d9a738a
parent17eaee31c3a30153bee5785f2224d389c4159db2
IMPORT: slz: implement a synchronous flush() operation

In some cases it may be desirable for latency reasons to forcefully
flush the queue even if it results in suboptimal compression. In our
case the queue might contain up to almost 4 bytes, which need an EOB
and a switch to literal mode, followed by 4 bytes to encode an empty
message. This means that each call can add 5 extra bytes in the ouput
stream. And the flush may also result in the header being produced for
the first time, which can amount to 2 or 10 bytes (zlib or gzip). In
the worst case, a total of 19 bytes may be emitted at once upon a flush
with 31 pending bits and a gzip header.

This is libslz upstream commit cf8c4668e4b4216e930b56338847d8d46a6bfda9.
include/import/slz.h
src/slz.c