]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: log/tools: fix ambiguous comments for some log encoding helpers
authorAurelien DARRAGON <adarragon@haproxy.com>
Thu, 6 Aug 2026 17:20:04 +0000 (19:20 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 7 Aug 2026 08:29:48 +0000 (10:29 +0200)
commitd156f6bac2f48482fd76119ff959a1d59fc9038b
tree65f48b2bd1fc3e3ea890f9164e7692a4892cc446
parentf495d486e60941548eb13b1e9700be868617471f
MINOR: log/tools: fix ambiguous comments for some log encoding helpers

Some log encoding helpers are not text oriented, and they will use all
available space since they will not try to write a terminating NULL
byte at the end of the produced output themselves. But since they
work similarly to text oriented ones, they return the address of
the byte immediately following the payload (where we expect
following bytes to be written). For text oriented ones this corresponds
in fact to the terminating NULL byte which was accounted in the
available space, while for non text-oriented ones, which doesn't reserve
space for the terminating NULL byte this corresponds to 1 byte past the
payload. If available space is strictly the size of the produced output,
then it means the returned address will be 1 byte PAST the stop limit so
no extra bytes could be written anymore. When using this helpers, callers
have to be very careful to reserve bytes (ie: terminating NULL byte) if
they need to.

It may be backported up to 3.0. Before that such ambiguities didn't exist
as logging features were strictly text-oriented and log encoders were not
available.
src/log.c
src/tools.c