[master] cfe912d Close a hypothetical loophole, that could let BAN'ed objects not get EXP'ed properly

Poul-Henning Kamp phk at FreeBSD.org
Mon Jan 27 15:51:49 CET 2014


commit cfe912d93cc81d798142ff00231092e6c300d56e
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Mon Jan 27 14:36:34 2014 +0000

    Close a hypothetical loophole, that could let BAN'ed objects not
    get EXP'ed properly

diff --git a/bin/varnishd/cache/cache_expire.c b/bin/varnishd/cache/cache_expire.c
index 0126357..f1b65f3 100644
--- a/bin/varnishd/cache/cache_expire.c
+++ b/bin/varnishd/cache/cache_expire.c
@@ -245,7 +245,7 @@ EXP_Rearm(struct object *o, double now, double ttl, double grace, double keep)
 	VSL(SLT_ExpKill, 0, "EXP_Rearm p=%p E=%.9f e=%.9f f=0x%x", oc,
 	    oc->timer_when, when, oc->flags);
 
-	if (oc->timer_when == when)
+	if (when > o->exp.t_origin && when > oc->timer_when)
 		return;
 
 	lru = oc_getlru(oc);
diff --git a/bin/varnishd/cache/cache_hash.c b/bin/varnishd/cache/cache_hash.c
index e9904b2..5d89c77 100644
--- a/bin/varnishd/cache/cache_hash.c
+++ b/bin/varnishd/cache/cache_hash.c
@@ -581,11 +581,6 @@ HSH_Purge(struct worker *wrk, struct objhead *oh, double ttl, double grace)
 			 */
 			continue;
 		}
-		xxxassert(spc > sizeof *ocp);
-
-		(void)oc_getobj(&wrk->stats, oc);
-		    /* XXX: still needed ? */
-
 		xxxassert(spc >= sizeof *ocp);
 		oc->refcnt++;
 		spc -= sizeof *ocp;



More information about the varnish-commit mailing list