[6.0] ec663c719 Include a timestamp in all CLI JSON responses.

Dridi Boukelmoune dridi.boukelmoune at gmail.com
Thu Aug 16 08:53:07 UTC 2018


commit ec663c719bd0e42eaa9199935dd05697bddf3540
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Wed Jun 6 08:28:53 2018 +0000

    Include a timestamp in all CLI JSON responses.
    
    Conflicts:
            bin/varnishd/cache/cache_director.c

diff --git a/lib/libvarnish/vcli_serve.c b/lib/libvarnish/vcli_serve.c
index b1084a162..de7ebdbd8 100644
--- a/lib/libvarnish/vcli_serve.c
+++ b/lib/libvarnish/vcli_serve.c
@@ -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);
 }
 


More information about the varnish-commit mailing list