Commit b02d9273 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Include a timestamp in all CLI JSON responses.

parent 9015fda0
......@@ -370,7 +370,7 @@ cli_backend_list(struct cli *cli, const char * const *av, void *priv)
return;
}
if (la->j) {
VCLI_JSON_begin(cli, 1, av);
VCLI_JSON_begin(cli, 2, av);
VCLI_Out(cli, ",\n");
VCLI_Out(cli, "{\n");
VSB_indent(cli->sb, 2);
......
......@@ -50,6 +50,7 @@
#include "vav.h"
#include "vcli_serve.h"
#include "vsb.h"
#include "vtim.h"
struct VCLS_fd {
unsigned magic;
......@@ -159,7 +160,7 @@ VCLS_func_help_json(struct cli *cli, const char * const *av, void *priv)
cs = cli->cls;
CHECK_OBJ_NOTNULL(cs, VCLS_MAGIC);
VCLI_JSON_begin(cli, 1, av);
VCLI_JSON_begin(cli, 2, av);
VTAILQ_FOREACH(clp, &cs->funcs, list) {
if (clp->auth > cli->auth)
continue;
......@@ -674,7 +675,7 @@ VCLI_JSON_begin(struct cli *cli, unsigned ver, const char * const * av)
if (av[i + 1] != NULL)
VCLI_Out(cli, ", ");
}
VCLI_Out(cli, "]");
VCLI_Out(cli, "], %.3f", VTIM_real());
VSB_indent(cli->sb, 2);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment