]> err.no Git - varnish/commitdiff
Revert commit 3163, fix in VRT_purge instead.
authortfheen <tfheen@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Mon, 8 Sep 2008 07:42:25 +0000 (07:42 +0000)
committertfheen <tfheen@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Mon, 8 Sep 2008 07:42:25 +0000 (07:42 +0000)
git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@3167 d4fa192b-c00b-0410-8231-f00ffab90ce4

varnish-cache/bin/varnishd/cache_vrt.c
varnish-cache/lib/libvcl/vcc_action.c

index 7c05549fea999126b8a9ff43f88bd89acb6efc93..f83c417f5fc311c8fde4365231235e4c81e9b6ff 100644 (file)
@@ -710,7 +710,8 @@ void
 VRT_purge(const char *regexp, int hash)
 {
        
-       (void)BAN_Add(NULL, regexp, hash);
+       if (regexp != NULL)
+               (void)BAN_Add(NULL, regexp, hash);
 }
 
 /*--------------------------------------------------------------------
index ac7bf711d173883b3cd21f35a680903c549fe1ad..00d29e2711a92b8a7ed2dc4f47f87281dcea8e0e 100644 (file)
@@ -336,26 +336,22 @@ parse_unset(struct tokenlist *tl)
 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");
 }