]> err.no Git - varnish/commitdiff
Truncate TTLs in the past to now.
authorphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Sat, 24 Jun 2006 21:42:27 +0000 (21:42 +0000)
committerphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Sat, 24 Jun 2006 21:42:27 +0000 (21:42 +0000)
git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@230 d4fa192b-c00b-0410-8231-f00ffab90ce4

varnish-cache/bin/varnishd/rfc2616.c

index 189447364d16895759acb639a651a3bd3e917b39..3e3c9d1781968c4dd1283c307db5d689f25dd39e 100644 (file)
@@ -80,7 +80,9 @@ RFC2616_Ttl(struct http *hp, time_t t_req, time_t t_resp)
                ttl = h_expires;
        if (ttl == 0)
                ttl = t_resp + heritage.default_ttl;
-       printf("TTL: %d (+%d)\n", ttl, ttl - t_resp);
+       printf("TTL: %d (%+d)\n", ttl, ttl - t_resp);
+       if (ttl < t_resp)
+               return (t_resp);
 
        return (ttl);
 }