--------------------- PatchSet 11247 Date: 2007/02/06 23:17:02 Author: hno Branch: HEAD Tag: (none) Log: Bug #1787: Objects stuck in cache if origin server clock in future Calculate the object expiry time relative to the adjusted object date, compensating for clock drift. Members: src/store.c:1.573->1.574 Index: squid/src/store.c =================================================================== RCS file: /cvsroot/squid/squid/src/store.c,v retrieving revision 1.573 retrieving revision 1.574 diff -u -r1.573 -r1.574 --- squid/src/store.c 26 Jan 2007 02:33:12 -0000 1.573 +++ squid/src/store.c 6 Feb 2007 23:17:02 -0000 1.574 @@ -1,6 +1,6 @@ /* - * $Id: store.c,v 1.573 2007/01/26 02:33:12 adrian Exp $ + * $Id: store.c,v 1.574 2007/02/06 23:17:02 hno Exp $ * * DEBUG: section 20 Storage Manager * AUTHOR: Harvest Derived @@ -1702,7 +1702,12 @@ if (age > squid_curtime - served_date) if (squid_curtime > age) served_date = squid_curtime - age; - entry->expires = reply->expires; + if (reply->expires > -1) { + if (reply->date > -1) + entry->expires = served_date + (reply->expires - reply->date); + else + entry->expires = reply->expires; + } entry->lastmod = reply->last_modified; entry->timestamp = served_date; }