From: phk Date: Mon, 19 Jan 2009 09:36:07 +0000 (+0000) Subject: Move the fiddling of banned objects to cache_ban.c X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4e1d433cca03b3dd768b035e97914ad515ac390d;p=varnish Move the fiddling of banned objects to cache_ban.c git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@3524 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- diff --git a/varnish-cache/bin/varnishd/cache_ban.c b/varnish-cache/bin/varnishd/cache_ban.c index 64ea9a38..56b8000e 100644 --- a/varnish-cache/bin/varnishd/cache_ban.c +++ b/varnish-cache/bin/varnishd/cache_ban.c @@ -518,6 +518,9 @@ BAN_CheckObject(struct object *o, const struct sess *sp) o->ban = b0; return (0); } else { + o->ttl = 0; + WSP(sp, SLT_ExpBan, "%u was banned", o->xid); + EXP_Rearm(o); o->ban = NULL; return (1); } diff --git a/varnish-cache/bin/varnishd/cache_hash.c b/varnish-cache/bin/varnishd/cache_hash.c index 20760bc0..9db6d813 100644 --- a/varnish-cache/bin/varnishd/cache_hash.c +++ b/varnish-cache/bin/varnishd/cache_hash.c @@ -255,12 +255,8 @@ HSH_Lookup(struct sess *sp) continue; if (o->ttl == 0) continue; - if (BAN_CheckObject(o, sp)) { - o->ttl = 0; - WSP(sp, SLT_ExpBan, "%u was banned", o->xid); - EXP_Rearm(o); + if (BAN_CheckObject(o, sp)) continue; - } if (o->vary != NULL && !VRY_Match(sp, o->vary)) continue;