]> err.no Git - varnish/commitdiff
Use the obj->entered timestamp when inserting into the expiry structures.
authorphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Fri, 12 Sep 2008 07:25:51 +0000 (07:25 +0000)
committerphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Fri, 12 Sep 2008 07:25:51 +0000 (07:25 +0000)
git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@3179 d4fa192b-c00b-0410-8231-f00ffab90ce4

varnish-cache/bin/varnishd/cache.h
varnish-cache/bin/varnishd/cache_center.c
varnish-cache/bin/varnishd/cache_expire.c

index de1e19b24054cc4fc8fe45a57b70a4a9c8a6d8a4..948dc3b705d497a60fde975dbdd92ea70366c5fd 100644 (file)
@@ -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);
index 84e1fec93801d9d8e17144711c3bc0441c03cdfc..d984a8d99f0ae84d5c6cae004dbfcdf4bdc53b43 100644 (file)
@@ -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++;
index 46f558c73ed68d052c48b5fbe9aa96e779cb9bab..d6b2f2f12f0240d2eae37a2e47d64fdc1a3f56fb 100644 (file)
@@ -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);