]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: ring/cli: support delimiting events with a trailing \0 on "show events"
authorWilly Tarreau <w@1wt.eu>
Mon, 31 Mar 2025 16:26:26 +0000 (18:26 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 8 Apr 2025 12:36:35 +0000 (14:36 +0200)
commitf4634e5a38b2c2cc48b095205dcbc138e2df4a23
treefc606d07685c97a1945ab8d2f32923d0bd38e133
parent0be6d73e889c4952aac7652638afa79ba2f6c752
MINOR: ring/cli: support delimiting events with a trailing \0 on "show events"

At the moment it is not supported to produce multi-line events on the
"show events" output, simply because the LF character is used as the
default end-of-event mark. However it could be convenient to produce
well-formatted multi-line events, e.g. in JSON or other formats. UNIX
utilities have already faced similar needs in the past and added
"-print0" to "find" and "-0" to "xargs" to mention that the delimiter
is the NUL character. This makes perfect sense since it's never present
in contents, so let's do exactly the same here.

Thus from now on, "show events <ring> -0" will delimit messages using
a \0 instead of a \n, permitting a better and safer encapsulation.
doc/management.txt
include/haproxy/ring-t.h
src/ring.c
src/sink.c