Commit fb02b299 authored by Martin Blix Grydeland's avatar Martin Blix Grydeland

Fix vcl.show for labels

When executing vcl.show for labels, show the VCL the label points to
instead of asserting.
parent 368c3ba5
......@@ -876,6 +876,11 @@ vcl_cli_show(struct cli *cli, const char * const *av, void *priv)
return;
}
CHECK_OBJ_NOTNULL(vcl, VCL_MAGIC);
if (vcl->label) {
vcl = vcl->label;
CHECK_OBJ_NOTNULL(vcl, VCL_MAGIC);
AZ(vcl->label);
}
CHECK_OBJ_NOTNULL(vcl->conf, VCL_CONF_MAGIC);
if (verbose) {
for (i = 0; i < vcl->conf->nsrc; i++)
......
......@@ -40,6 +40,8 @@ varnish v1 -cliok "vcl.label foo vcl2"
varnish v1 -cliok "vcl.label bar vcl2"
varnish v1 -cliok "vcl.list"
varnish v1 -clijson "vcl.list -j"
varnish v1 -cliok "vcl.show foo"
varnish v1 -cliok "vcl.show -v bar"
varnish v1 -clierr 300 "vcl.discard vcl2"
varnish v1 -cliok "vcl.discard bar"
varnish v1 -cliok "vcl.label foo vcl1"
......
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