From: phk Date: Tue, 17 Jun 2008 20:52:00 +0000 (+0000) Subject: Add -cli command. X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6c26d356c1fe08e22aeeb24004bb1706a621d8cf;p=varnish Add -cli command. Always reset XID to 1000 on start. git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2733 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- diff --git a/varnish-cache/bin/varnishtest/vtc_varnish.c b/varnish-cache/bin/varnishtest/vtc_varnish.c index 03119cde..c717032d 100644 --- a/varnish-cache/bin/varnishtest/vtc_varnish.c +++ b/varnish-cache/bin/varnishtest/vtc_varnish.c @@ -239,11 +239,15 @@ varnish_launch(struct varnish *v) static void varnish_start(struct varnish *v) { + unsigned u; if (v->cli_fd < 0) varnish_launch(v); printf("## %-4s Start\n", v->name); - varnish_ask_cli(v, "start", NULL); + u = varnish_ask_cli(v, "start", NULL); + assert(u == CLIS_OK); + u = varnish_ask_cli(v, "debug.xid 1000", NULL); + assert(u == CLIS_OK); } /********************************************************************** @@ -285,6 +289,21 @@ varnish_wait(struct varnish *v) printf("## %-4s R %d Status: %04x\n", v->name, r, status); } +/********************************************************************** + * Ask a CLI question + */ + +static void +varnish_cli(struct varnish *v, const char *cli) +{ + unsigned u; + + if (v->cli_fd < 0) + varnish_launch(v); + u = varnish_ask_cli(v, cli, NULL); + printf("## %-4s CLI %03u <%s>\n", v->name, u, cli); +} + /********************************************************************** * Load a VCL program */ @@ -433,6 +452,11 @@ cmd_varnish(char **av, void *priv) av++; continue; } + if (!strcmp(*av, "-cli")) { + varnish_cli(v, av[1]); + av++; + continue; + } if (!strcmp(*av, "-launch")) { varnish_launch(v); continue;