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]
+show events [<sink>] [-w] [-n] [-0]
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
be discarded) or by closing the session. Finally, option "-n" is used to
directly seek to the end of the buffer, which is often convenient when
combined with "-w" to only report new events. For convenience, "-wn" or "-nw"
- may be used to enable both options at once.
+ may be used to enable both options at once. By default, all events are
+ delimited by a line feed character ('\n' or 10 or 0x0A). It is possible to
+ change this to the NUL character ('\0' or 0) by passing the "-0" argument.
show fd [-!plcfbsd]* [<fd>]
Dump the list of either all open file descriptors or just the one number <fd>
/* ring watch flags to be used when watching the ring */
#define RING_WF_WAIT_MODE 0x00000001 /* wait for new contents */
#define RING_WF_SEEK_NEW 0x00000002 /* seek to new contents */
+#define RING_WF_END_ZERO 0x00000004 /* mark end of events with \0 instead of \n */
/* ring flags */
#define RING_FL_MAPPED 0x00000001 /* mmapped area, must not free() */
MT_LIST_DELETE(&appctx->wait_entry);
- ret = ring_dispatch_messages(ring, appctx, &ctx->ofs, &last_ofs, ctx->flags, applet_append_line, '\n', NULL);
+ ret = ring_dispatch_messages(ring, appctx, &ctx->ofs, &last_ofs, ctx->flags, applet_append_line,
+ (ctx->flags & RING_WF_END_ZERO) ? 0 : '\n', NULL);
if (ret && (ctx->flags & RING_WF_WAIT_MODE)) {
/* we've drained everything and are configured to wait for more
if (!*args[1]) {
/* no arg => report the list of supported sink */
- chunk_printf(&trash, "Supported events sinks are listed below. Add -w(wait), -n(new). Any key to stop\n");
+ chunk_printf(&trash, "Supported events sinks are listed below. Add -0(zero), -w(wait), -n(new). 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,
ring_flags |= RING_WF_WAIT_MODE;
else if (strcmp(args[arg], "-n") == 0)
ring_flags |= RING_WF_SEEK_NEW;
+ else if (strcmp(args[arg], "-0") == 0)
+ ring_flags |= RING_WF_END_ZERO;
else if (strcmp(args[arg], "-nw") == 0 || strcmp(args[arg], "-wn") == 0)
ring_flags |= RING_WF_WAIT_MODE | RING_WF_SEEK_NEW;
else
REGISTER_POST_DEINIT(sink_deinit);
static struct cli_kw_list cli_kws = {{ },{
- { { "show", "events", NULL }, "show events [<sink>] [-w] [-n] : show event sink state", cli_parse_show_events, NULL, NULL },
+ { { "show", "events", NULL }, "show events [<sink>] [-w] [-n] [-0] : show event sink state", cli_parse_show_events, NULL, NULL },
{{},}
}};