r3167 - in trunk/varnish-cache: bin/varnishd lib/libvcl

tfheen at projects.linpro.no tfheen at projects.linpro.no
Mon Sep 8 09:42:25 CEST 2008


Author: tfheen
Date: 2008-09-08 09:42:25 +0200 (Mon, 08 Sep 2008)
New Revision: 3167

Modified:
   trunk/varnish-cache/bin/varnishd/cache_vrt.c
   trunk/varnish-cache/lib/libvcl/vcc_action.c
Log:
Revert commit 3163, fix in VRT_purge instead.


Modified: trunk/varnish-cache/bin/varnishd/cache_vrt.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_vrt.c	2008-09-07 17:31:13 UTC (rev 3166)
+++ trunk/varnish-cache/bin/varnishd/cache_vrt.c	2008-09-08 07:42:25 UTC (rev 3167)
@@ -710,7 +710,8 @@
 VRT_purge(const char *regexp, int hash)
 {
 	
-	(void)BAN_Add(NULL, regexp, hash);
+	if (regexp != NULL)
+		(void)BAN_Add(NULL, regexp, hash);
 }
 
 /*--------------------------------------------------------------------

Modified: trunk/varnish-cache/lib/libvcl/vcc_action.c
===================================================================
--- trunk/varnish-cache/lib/libvcl/vcc_action.c	2008-09-07 17:31:13 UTC (rev 3166)
+++ trunk/varnish-cache/lib/libvcl/vcc_action.c	2008-09-08 07:42:25 UTC (rev 3167)
@@ -336,26 +336,22 @@
 static void
 parse_purge_url(struct tokenlist *tl)
 {
-	struct var *vp;
 
 	vcc_NextToken(tl);
 	
+	Fb(tl, 1, "VRT_purge(");
+	
 	Expect(tl, '(');
 	vcc_NextToken(tl);
 	
-	vp = vcc_FindVar(tl, tl->t, vcc_vars);
-	ERRCHK(tl);
-	assert(vp != NULL);
-	if (vp->fmt != STRING) {
+	if (!vcc_StringVal(tl)) {
 		vcc_ExpectedStringval(tl);
 		return;
 	}
 	
-	Fb(tl, 1, "if (%s) VRT_purge(%s, 0);\n", vp->rname, vp->rname);
-	vcc_NextToken(tl);
-
 	Expect(tl, ')');
 	vcc_NextToken(tl);
+	Fb(tl, 0, ", 0);\n");
 }
 
 




More information about the varnish-commit mailing list