From: Willy Tarreau Date: Mon, 7 Sep 2026 13:47:08 +0000 (+0200) Subject: MINOR: ring: add "-r" to "show events" to dump in raw mode (undoes "-s") X-Git-Tag: v3.5-dev7~68 X-Git-Url: https://git.kaiwu.me/$%7BISSUES%7D/static/gitweb.js?a=commitdiff_plain;h=b492cdae02195bad35a80e4322aa785251ef0142;p=haproxy.git MINOR: ring: add "-r" to "show events" to dump in raw mode (undoes "-s") In anticipation for a possible future change of the default output which might eventually become sanitized by default, let's add "-r" which does the opposite of "-s", and turns the output back to raw. This can be used by tools trying to be future-proof that do not want to depend on the default setting. --- diff --git a/doc/management.txt b/doc/management.txt index 61b592a63..9f8f7df14 100644 --- a/doc/management.txt +++ b/doc/management.txt @@ -3185,7 +3185,7 @@ show errors [|] [request|response] error was at byte 23. This is the slash ('/') in header name "header/bizarre", which is not a valid HTTP character for a header name. -show events [] [-w] [-n] [-0] [-s] +show events [] [-w] [-n] [-0] [-r] [-s] With no option, this lists all known event sinks and their types. With an option, it will dump all available events in the designated sink if it is of type buffer. If option "-w" is passed after the sink name, then once the end @@ -3206,7 +3206,9 @@ show events [] [-w] [-n] [-0] [-s] escape sequences nor writing direction codes into the operator's terminal, which is useful when dumping to a terminal, or to a program whose input must not be interpreted as special (e.g. monitoring scripts whose output is copied - verbatim into reports). + verbatim into reports). Finally, "-r" undoes "-s" and may be appended in + cases where "-s" was unconditionally appended, or as a future-proof way to + ensure long-term compatibility in case the default changes. show fd [-!plcfbs]* [[]/[] | ] Dump the list of either all open file descriptors or just the one number diff --git a/src/sink.c b/src/sink.c index 2ae4e202d..ea6fe987d 100644 --- a/src/sink.c +++ b/src/sink.c @@ -363,7 +363,7 @@ static int cli_parse_show_events(char **args, char *payload, struct appctx *appc if (!*args[1]) { /* no arg => report the list of supported sink */ - chunk_printf(&trash, "Supported events sinks are listed below. Add -0(zero), -w(wait), -n(new), -s(anitize). Any key to stop.\n"); + chunk_printf(&trash, "Supported events sinks are listed below. Add -0(zero), -w(wait), -n(new), -r(raw), -s(anitize). Any key to stop.\n"); list_for_each_entry(sink, &sink_list, sink_list) { chunk_appendf(&trash, " %-10s : type=%s, %u dropped, %s\n", sink->name, @@ -399,6 +399,8 @@ static int cli_parse_show_events(char **args, char *payload, struct appctx *appc ring_flags |= RING_WF_WAIT_MODE | RING_WF_SEEK_NEW; else if (strcmp(args[arg], "-s") == 0) ring_flags |= RING_WF_SANITIZE; + else if (strcmp(args[arg], "-r") == 0) + ring_flags &= ~RING_WF_SANITIZE; else return cli_err(appctx, "unknown option"); }