From: phk Date: Fri, 12 Sep 2008 07:32:04 +0000 (+0000) Subject: Assert that we have obj->entered before we calculate TTL using it. X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1d6172050a5a983c4b4fd24b08d8b56512890ac1;p=varnish Assert that we have obj->entered before we calculate TTL using it. git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@3180 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- diff --git a/varnish-cache/bin/varnishd/rfc2616.c b/varnish-cache/bin/varnishd/rfc2616.c index 1f4383b6..1c5a2857 100644 --- a/varnish-cache/bin/varnishd/rfc2616.c +++ b/varnish-cache/bin/varnishd/rfc2616.c @@ -36,6 +36,7 @@ #include #include #include +#include #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;