From: phk Date: Sat, 21 Jun 2008 08:39:14 +0000 (+0000) Subject: Assert that deadlines are not NAN X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0c231397015deb351b11cbf4ba9bb8787679851e;p=varnish Assert that deadlines are not NAN git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2754 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- diff --git a/varnish-cache/bin/varnishd/cache_expire.c b/varnish-cache/bin/varnishd/cache_expire.c index 245fc0c8..33478915 100644 --- a/varnish-cache/bin/varnishd/cache_expire.c +++ b/varnish-cache/bin/varnishd/cache_expire.c @@ -55,6 +55,7 @@ #include #include #include +#include #include "shmlog.h" #include "binary_heap.h" @@ -150,6 +151,7 @@ update_object_when(const struct object *o) oe->timer_when = o->ttl + HSH_Grace(o->grace); oe->timer_what = tmr_ttl; } + assert(!isnan(oe->timer_when)); } /*-------------------------------------------------------------------- @@ -259,7 +261,7 @@ exp_timer(void *arg) struct object *o; double t; struct sess *sp; - unsigned char log[1024]; /* XXX size ? */ + unsigned char logbuf[1024]; /* XXX size ? */ THR_Name("cache-timeout"); (void)arg; @@ -268,8 +270,8 @@ exp_timer(void *arg) XXXAN(sp); sp->wrk = &ww; ww.magic = WORKER_MAGIC; - ww.wlp = ww.wlb = log; - ww.wle = log + sizeof log; + ww.wlp = ww.wlb = logbuf; + ww.wle = logbuf + sizeof logbuf; AZ(sleep(10)); /* XXX: Takes time for VCL to arrive */ VCL_Get(&sp->vcl);