Mailing List Archive

r3180 - trunk/varnish-cache/bin/varnishd
Author: phk
Date: 2008-09-12 09:32:04 +0200 (Fri, 12 Sep 2008)
New Revision: 3180

Modified:
trunk/varnish-cache/bin/varnishd/rfc2616.c
Log:
Assert that we have obj->entered before we calculate TTL using it.



Modified: trunk/varnish-cache/bin/varnishd/rfc2616.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/rfc2616.c 2008-09-12 07:25:51 UTC (rev 3179)
+++ trunk/varnish-cache/bin/varnishd/rfc2616.c 2008-09-12 07:32:04 UTC (rev 3180)
@@ -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 @@
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;