Commit 556753ed authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Add -badvcl for VCL code we expect the compiler to whine about.



git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@2879 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent d8e17348
...@@ -310,7 +310,7 @@ varnish_cli(struct varnish *v, const char *cli) ...@@ -310,7 +310,7 @@ varnish_cli(struct varnish *v, const char *cli)
*/ */
static void static void
varnish_vcl(struct varnish *v, const char *vcl) varnish_vcl(struct varnish *v, const char *vcl, enum cli_status_e expect)
{ {
struct vsb *vsb; struct vsb *vsb;
enum cli_status_e u; enum cli_status_e u;
...@@ -343,13 +343,15 @@ varnish_vcl(struct varnish *v, const char *vcl) ...@@ -343,13 +343,15 @@ varnish_vcl(struct varnish *v, const char *vcl)
AZ(vsb_overflowed(vsb)); AZ(vsb_overflowed(vsb));
u = varnish_ask_cli(v, vsb_data(vsb), NULL); u = varnish_ask_cli(v, vsb_data(vsb), NULL);
assert(u == CLIS_OK); assert(u == expect);
vsb_clear(vsb); if (u == CLIS_OK) {
vsb_printf(vsb, "vcl.use vcl%d", v->vcl_nbr); vsb_clear(vsb);
vsb_finish(vsb); vsb_printf(vsb, "vcl.use vcl%d", v->vcl_nbr);
AZ(vsb_overflowed(vsb)); vsb_finish(vsb);
u = varnish_ask_cli(v, vsb_data(vsb), NULL); AZ(vsb_overflowed(vsb));
assert(u == CLIS_OK); u = varnish_ask_cli(v, vsb_data(vsb), NULL);
assert(u == CLIS_OK);
}
vsb_delete(vsb); vsb_delete(vsb);
} }
...@@ -466,8 +468,13 @@ cmd_varnish(CMD_ARGS) ...@@ -466,8 +468,13 @@ cmd_varnish(CMD_ARGS)
av++; av++;
continue; continue;
} }
if (!strcmp(*av, "-badvcl")) {
varnish_vcl(v, av[1], CLIS_PARAM);
av++;
continue;
}
if (!strcmp(*av, "-vcl")) { if (!strcmp(*av, "-vcl")) {
varnish_vcl(v, av[1]); varnish_vcl(v, av[1], CLIS_OK);
av++; av++;
continue; 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