]> err.no Git - varnish/commitdiff
Assert that we have obj->entered before we calculate TTL using it.
authorphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Fri, 12 Sep 2008 07:32:04 +0000 (07:32 +0000)
committerphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Fri, 12 Sep 2008 07:32:04 +0000 (07:32 +0000)
git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@3180 d4fa192b-c00b-0410-8231-f00ffab90ce4

varnish-cache/bin/varnishd/rfc2616.c

index 1f4383b6e87eef9b77742df51e10e3895d5bf11a..1c5a2857220ad557500389a70a7315d581d47cbf 100644 (file)
@@ -36,6 +36,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <limits.h>
+#include <math.h>
 
 #include "shmlog.h"
 #include "cache.h"
@@ -75,6 +76,7 @@ RFC2616_Ttl(const struct sess *sp, const struct http *hp, struct object *obj)
        double h_date, h_expires, ttd;
        char *p;
 
+       assert(obj->entered != 0.0 && !isnan(sp->obj->entered));
        /* If all else fails, cache using default ttl */
        ttl = params->default_ttl;