]> err.no Git - varnish/commitdiff
Add -cli command.
authorphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Tue, 17 Jun 2008 20:52:00 +0000 (20:52 +0000)
committerphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Tue, 17 Jun 2008 20:52:00 +0000 (20:52 +0000)
Always reset XID to 1000 on start.

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2733 d4fa192b-c00b-0410-8231-f00ffab90ce4

varnish-cache/bin/varnishtest/vtc_varnish.c

index 03119cdefe7612d15608f75d2c2f65a0d2853210..c717032d19d67ef06705da9bd3a3c4df25917d77 100644 (file)
@@ -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;