]> git.kaiwu.me - haproxy.git/commitdiff
MINOR: ring: add "-r" to "show events" to dump in raw mode (undoes "-s")
authorWilly Tarreau <w@1wt.eu>
Mon, 7 Sep 2026 13:47:08 +0000 (15:47 +0200)
committerWilly Tarreau <w@1wt.eu>
Mon, 7 Sep 2026 14:29:16 +0000 (16:29 +0200)
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.

doc/management.txt
src/sink.c

index 61b592a631e279a5757baf1fc9fab228b33344bb..9f8f7df145e0b78ea1415bca754e8be8032955ef 100644 (file)
@@ -3185,7 +3185,7 @@ show errors [<iid>|<proxy>] [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 [<sink>] [-w] [-n] [-0] [-s]
+show events [<sink>] [-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 [<sink>] [-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]* [[<tgid>]/[<fd>] | <fd>]
   Dump the list of either all open file descriptors or just the one number <fd>
index 2ae4e202d263efb2cb9544b5149cb991b923835f..ea6fe987d504391a19f210f548830f6bf44892be 100644 (file)
@@ -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");
        }