From: wessels <> Date: Fri, 23 Feb 2001 03:53:15 +0000 (+0000) Subject: Avoid making 'served_date' negative in storeTimestampsSet(). X-Git-Tag: SQUID_3_0_PRE1~1592 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=212cbb487cd19b531730e1ad5389d2c46d591466;p=thirdparty%2Fsquid.git Avoid making 'served_date' negative in storeTimestampsSet(). --- diff --git a/src/store.cc b/src/store.cc index f929e7fe40..9ba6228fa9 100644 --- a/src/store.cc +++ b/src/store.cc @@ -1,6 +1,6 @@ /* - * $Id: store.cc,v 1.536 2001/01/12 00:37:21 wessels Exp $ + * $Id: store.cc,v 1.537 2001/02/22 20:53:15 wessels Exp $ * * DEBUG: section 20 Storage Manager * AUTHOR: Harvest Derived @@ -1027,11 +1027,14 @@ storeTimestampsSet(StoreEntry * entry) if (served_date < 0 || served_date > squid_curtime) served_date = squid_curtime; /* - * Compensate with Age header if origin server clock is ahead of us - * and there is a cache in between us and the origin server + * Compensate with Age header if origin server clock is ahead + * of us and there is a cache in between us and the origin + * server. But DONT compensate if the age value is larger than + * squid_curtime because it results in a negative served_date. */ if (age > squid_curtime - served_date) - served_date = squid_curtime - age; + if (squid_curtime < age) + served_date = squid_curtime - age; entry->expires = reply->expires; entry->lastmod = reply->last_modified; entry->timestamp = served_date;