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)
*/
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;
enum cli_status_e u;
......@@ -343,13 +343,15 @@ varnish_vcl(struct varnish *v, const char *vcl)
AZ(vsb_overflowed(vsb));
u = varnish_ask_cli(v, vsb_data(vsb), NULL);
assert(u == CLIS_OK);
vsb_clear(vsb);
vsb_printf(vsb, "vcl.use vcl%d", v->vcl_nbr);
vsb_finish(vsb);
AZ(vsb_overflowed(vsb));
u = varnish_ask_cli(v, vsb_data(vsb), NULL);
assert(u == CLIS_OK);
assert(u == expect);
if (u == CLIS_OK) {
vsb_clear(vsb);
vsb_printf(vsb, "vcl.use vcl%d", v->vcl_nbr);
vsb_finish(vsb);
AZ(vsb_overflowed(vsb));
u = varnish_ask_cli(v, vsb_data(vsb), NULL);
assert(u == CLIS_OK);
}
vsb_delete(vsb);
}
......@@ -466,8 +468,13 @@ cmd_varnish(CMD_ARGS)
av++;
continue;
}
if (!strcmp(*av, "-badvcl")) {
varnish_vcl(v, av[1], CLIS_PARAM);
av++;
continue;
}
if (!strcmp(*av, "-vcl")) {
varnish_vcl(v, av[1]);
varnish_vcl(v, av[1], CLIS_OK);
av++;
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