From 4e1d433cca03b3dd768b035e97914ad515ac390d Mon Sep 17 00:00:00 2001 From: phk Date: Mon, 19 Jan 2009 09:36:07 +0000 Subject: [PATCH] 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 --- varnish-cache/bin/varnishd/cache_ban.c | 3 +++ varnish-cache/bin/varnishd/cache_hash.c | 6 +----- 2 files changed, 4 insertions(+), 5 deletions(-) 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; -- 2.39.5