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

Add -cli command.

Always reset XID to 1000 on start.



git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@2733 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent e5477804
......@@ -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;
......
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