[master] f830854 vcc_err_unref=false should also allow unreferenced subroutines.

Poul-Henning Kamp phk at varnish-cache.org
Tue May 10 13:02:47 CEST 2011


commit f830854cdbaf40870d810d35d1cd6667352f0daa
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Tue May 10 10:55:28 2011 +0000

    vcc_err_unref=false should also allow unreferenced subroutines.
    
    Submitted by:	ehocdet
    
    Fixes	#911

diff --git a/bin/varnishtest/tests/r00911.vtc b/bin/varnishtest/tests/r00911.vtc
new file mode 100644
index 0000000..f85556c
--- /dev/null
+++ b/bin/varnishtest/tests/r00911.vtc
@@ -0,0 +1,20 @@
+varnishtest "vcc_err_unref should also cover subs"
+
+server s1 {
+	rxreq
+	expect req.url == "/bar"
+	txresp -body "foobar"
+} -start
+
+varnish v1 -arg "-p vcc_err_unref=false" -vcl+backend { 
+	sub foobar {
+		set req.http.foobar = "foobar";
+	}
+} -start
+
+client c1 {
+	txreq  -url /bar
+	rxresp 
+	expect resp.http.content-length == 6
+	expect resp.bodylen == 6
+} -run
diff --git a/lib/libvcl/vcc_xref.c b/lib/libvcl/vcc_xref.c
index f76d910..17b3a8a 100644
--- a/lib/libvcl/vcc_xref.c
+++ b/lib/libvcl/vcc_xref.c
@@ -292,6 +292,10 @@ vcc_checkaction2(struct vcc *tl, const struct symbol *sym)
 		return;
 	vsb_printf(tl->sb, "Function unused\n");
 	vcc_ErrWhere(tl, p->name);
+	if (!tl->err_unref) {
+		vsb_printf(tl->sb, "(That was just a warning)\n");
+		tl->err = 0;
+	}
 }
 
 int



More information about the varnish-commit mailing list