[master] e407f7c10 Revert "Don't panic if you try to relabel a VCL with the same label."

Poul-Henning Kamp phk at FreeBSD.org
Fri May 3 06:48:07 UTC 2019


commit e407f7c10cbc2be786e0e2d890e2548d3faf1886
Author: Nils Goroll <nils.goroll at uplex.de>
Date:   Mon Feb 18 14:23:19 2019 +0100

    Revert "Don't panic if you try to relabel a VCL with the same label."
    
    This reverts commit 4709fae3a703b5904a799b8aa1df2872e803219f.

diff --git a/bin/varnishd/mgt/mgt_vcl.c b/bin/varnishd/mgt/mgt_vcl.c
index 161063221..6e1bc5639 100644
--- a/bin/varnishd/mgt/mgt_vcl.c
+++ b/bin/varnishd/mgt/mgt_vcl.c
@@ -923,13 +923,6 @@ mcf_vcl_label(struct cli *cli, const char * const *av, void *priv)
 			VCLI_Out(cli, "%s is not a label", vpl->name);
 			return;
 		}
-		if (!VTAILQ_EMPTY(&vpl->dfrom) &&
-		    VTAILQ_FIRST(&vpl->dfrom)->to == vpt) {
-			VCLI_SetResult(cli, CLIS_PARAM);
-			VCLI_Out(cli, "VCL '%s' already has label '%s'",
-			    vpt->name, vpl->name);
-			return;
-		}
 		if (!VTAILQ_EMPTY(&vpt->dfrom) &&
 		    !VTAILQ_EMPTY(&vpl->dto)) {
 			VCLI_SetResult(cli, CLIS_PARAM);
diff --git a/bin/varnishtest/tests/c00077.vtc b/bin/varnishtest/tests/c00077.vtc
index c32983893..49ed76797 100644
--- a/bin/varnishtest/tests/c00077.vtc
+++ b/bin/varnishtest/tests/c00077.vtc
@@ -13,10 +13,6 @@ varnish v1 -vcl+backend {
 
 varnish v1 -clierr 106 "vcl.label vcl.A vcl1"
 varnish v1 -cliok "vcl.label vclA vcl1"
-varnish v1 -clierr 106 "vcl.label vclA vcl1"
-varnish v1 -cliexpect {VCL 'vcl1' already has label 'vclA'} {
-	vcl.label vclA vcl1
-}
 
 varnish v1 -vcl+backend {
 	sub vcl_recv {


More information about the varnish-commit mailing list