From 3f97b5b84696a0deff0dafd9ed7f7d7c8fb2cb02 Mon Sep 17 00:00:00 2001 From: Barry Dobyns Date: Sat, 27 Aug 2011 01:43:33 -0600 Subject: [PATCH] Bug 1791: timestampsSet does not validate Date: if server sends very old date --- src/store.cc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/store.cc b/src/store.cc index be313eb331..c1c2b7b232 100644 --- a/src/store.cc +++ b/src/store.cc @@ -1493,6 +1493,14 @@ StoreEntry::timestampsSet() if (served_date < 0 || served_date > squid_curtime) served_date = squid_curtime; + /* Bug 1791: + * If the returned Date: is more than 24 hours older than + * the squid_curtime, then one of us needs to use NTP to set our + * clock. We'll pretend that our clock is right. + */ + else if (served_date < (squid_curtime - 24 * 60 * 60) ) + 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 -- 2.47.2