From 4199cffdf0b177b3973e6f3f03eff9a094776823 Mon Sep 17 00:00:00 2001 From: phk Date: Fri, 20 Jun 2008 07:32:38 +0000 Subject: [PATCH] Use default_grace consistently or it will all be in vain. Submitted by: sky Fixes: ticket 253 git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2737 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- varnish-cache/bin/varnishd/cache.h | 1 + varnish-cache/bin/varnishd/cache_expire.c | 2 +- varnish-cache/bin/varnishd/cache_hash.c | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/varnish-cache/bin/varnishd/cache.h b/varnish-cache/bin/varnishd/cache.h index d572f008..b138a1a4 100644 --- a/varnish-cache/bin/varnishd/cache.h +++ b/varnish-cache/bin/varnishd/cache.h @@ -462,6 +462,7 @@ struct object *HSH_Lookup(struct sess *sp); void HSH_Unbusy(struct sess *sp); void HSH_Ref(struct object *o); void HSH_Deref(struct object *o); +double HSH_Grace(double g); void HSH_Init(void); /* cache_http.c */ diff --git a/varnish-cache/bin/varnishd/cache_expire.c b/varnish-cache/bin/varnishd/cache_expire.c index c3762bfd..245fc0c8 100644 --- a/varnish-cache/bin/varnishd/cache_expire.c +++ b/varnish-cache/bin/varnishd/cache_expire.c @@ -147,7 +147,7 @@ update_object_when(const struct object *o) oe->timer_when = o->prefetch; oe->timer_what = tmr_prefetch; } else { - oe->timer_when = o->ttl + o->grace; + oe->timer_when = o->ttl + HSH_Grace(o->grace); oe->timer_what = tmr_ttl; } } diff --git a/varnish-cache/bin/varnishd/cache_hash.c b/varnish-cache/bin/varnishd/cache_hash.c index 4f736ae2..46e00e66 100644 --- a/varnish-cache/bin/varnishd/cache_hash.c +++ b/varnish-cache/bin/varnishd/cache_hash.c @@ -67,7 +67,7 @@ static struct hash_slinger *hash; -static double +double HSH_Grace(double g) { if (isnan(g)) -- 2.39.5