From: phk Date: Fri, 12 Sep 2008 07:25:51 +0000 (+0000) Subject: Use the obj->entered timestamp when inserting into the expiry structures. X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ccaa8bac06048ea92b97407dd90bf8ff4545b570;p=varnish Use the obj->entered timestamp when inserting into the expiry structures. git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@3179 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- diff --git a/varnish-cache/bin/varnishd/cache.h b/varnish-cache/bin/varnishd/cache.h index de1e19b2..948dc3b7 100644 --- a/varnish-cache/bin/varnishd/cache.h +++ b/varnish-cache/bin/varnishd/cache.h @@ -435,7 +435,7 @@ extern pthread_t cli_thread; #define ASSERT_CLI() do {assert(pthread_self() == cli_thread);} while (0) /* cache_expiry.c */ -void EXP_Insert(struct object *o, double now); +void EXP_Insert(struct object *o); void EXP_Init(void); void EXP_Rearm(const struct object *o); void EXP_Touch(const struct object *o, double now); diff --git a/varnish-cache/bin/varnishd/cache_center.c b/varnish-cache/bin/varnishd/cache_center.c index 84e1fec9..d984a8d9 100644 --- a/varnish-cache/bin/varnishd/cache_center.c +++ b/varnish-cache/bin/varnishd/cache_center.c @@ -434,8 +434,7 @@ cnt_fetch(struct sess *sp) sp->obj->cacheable = 1; if (sp->obj->objhead != NULL) { VRY_Create(sp); - assert(!isnan(sp->wrk->used)); - EXP_Insert(sp->obj, sp->wrk->used); + EXP_Insert(sp->obj); HSH_Unbusy(sp); } sp->wrk->acct.fetch++; diff --git a/varnish-cache/bin/varnishd/cache_expire.c b/varnish-cache/bin/varnishd/cache_expire.c index 46f558c7..d6b2f2f1 100644 --- a/varnish-cache/bin/varnishd/cache_expire.c +++ b/varnish-cache/bin/varnishd/cache_expire.c @@ -162,7 +162,7 @@ update_object_when(const struct object *o) */ void -EXP_Insert(struct object *o, double now) +EXP_Insert(struct object *o) { struct objexp *oe; @@ -173,7 +173,8 @@ EXP_Insert(struct object *o, double now) add_objexp(o); oe = o->objexp; - oe->lru_stamp = now; + assert(o->entered != 0 && !isnan(o->entered)); + oe->lru_stamp = o->entered; update_object_when(o); LOCK(&exp_mtx); binheap_insert(exp_heap, oe);