[master] 9a8a771 Fix a uncommon corner-case with vcl labels

Poul-Henning Kamp phk at FreeBSD.org
Mon Aug 15 11:03:08 CEST 2016


commit 9a8a77121b8eb9ee8c39fddceb74abfaa3a269c9
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Mon Aug 15 09:01:53 2016 +0000

    Fix a uncommon corner-case with vcl labels

diff --git a/bin/varnishd/cache/cache_vcl.c b/bin/varnishd/cache/cache_vcl.c
index 41ae747..8a31e73 100644
--- a/bin/varnishd/cache/cache_vcl.c
+++ b/bin/varnishd/cache/cache_vcl.c
@@ -100,6 +100,7 @@ VCL_Panic(struct vsb *vsb, const struct vcl *vcl)
 	VSB_printf(vsb, "vcl = {\n");
 	VSB_indent(vsb, 2);
 	PAN_CheckMagic(vsb, vcl, VCL_MAGIC);
+	VSB_printf(vsb, "name = \"%s\"\n", vcl->loaded_name);
 	VSB_printf(vsb, "busy = %u\n", vcl->busy);
 	VSB_printf(vsb, "discard = %u,\n", vcl->discard);
 	VSB_printf(vsb, "state = %s,\n", vcl->state);
@@ -165,6 +166,8 @@ VCL_Get(struct vcl **vcc)
 	AN(vcl_active);
 	if (vcl_active->label == NULL)
 		*vcc = vcl_active;
+	else if (strcmp(vcl_active->state, VCL_TEMP_LABEL))
+		*vcc = vcl_active;
 	else
 		*vcc = vcl_active->label;
 	AN(*vcc);
diff --git a/bin/varnishtest/tests/v00048.vtc b/bin/varnishtest/tests/v00048.vtc
index 744047d..bef46c1 100644
--- a/bin/varnishtest/tests/v00048.vtc
+++ b/bin/varnishtest/tests/v00048.vtc
@@ -89,3 +89,8 @@ varnish v1 -cliok "vcl.use vcl1"
 varnish v1 -cliok "vcl.discard foo"
 varnish v1 -clierr 106 "vcl.discard foo"
 
+varnish v1 -start
+varnish v1 -cliok "vcl.label snarf vcl1"
+server s1 -start
+client c1 -run
+



More information about the varnish-commit mailing list