From 0356e0661e99c319aa1b4358a280b7cf6e6a6dfa Mon Sep 17 00:00:00 2001 From: tfheen Date: Mon, 8 Sep 2008 07:42:25 +0000 Subject: [PATCH] Revert commit 3163, fix in VRT_purge instead. git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@3167 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- varnish-cache/bin/varnishd/cache_vrt.c | 3 ++- varnish-cache/lib/libvcl/vcc_action.c | 12 ++++-------- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/varnish-cache/bin/varnishd/cache_vrt.c b/varnish-cache/bin/varnishd/cache_vrt.c index 7c05549f..f83c417f 100644 --- a/varnish-cache/bin/varnishd/cache_vrt.c +++ b/varnish-cache/bin/varnishd/cache_vrt.c @@ -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); } /*-------------------------------------------------------------------- diff --git a/varnish-cache/lib/libvcl/vcc_action.c b/varnish-cache/lib/libvcl/vcc_action.c index ac7bf711..00d29e27 100644 --- a/varnish-cache/lib/libvcl/vcc_action.c +++ b/varnish-cache/lib/libvcl/vcc_action.c @@ -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"); } -- 2.39.5