]> err.no Git - varnish/commitdiff
Assert that deadlines are not NAN
authorphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Sat, 21 Jun 2008 08:39:14 +0000 (08:39 +0000)
committerphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Sat, 21 Jun 2008 08:39:14 +0000 (08:39 +0000)
git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2754 d4fa192b-c00b-0410-8231-f00ffab90ce4

varnish-cache/bin/varnishd/cache_expire.c

index 245fc0c87861f8e84eb3e62e3fd5e3aa0ee51fa2..3347891546d9d948a1c366ff1b284f8a142c251c 100644 (file)
@@ -55,6 +55,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#include <math.h>
 
 #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);