--------------------- PatchSet 11273 Date: 2007/02/27 01:14:21 Author: hno Branch: HEAD Tag: (none) Log: Further fixes in dealing with non-refreshable expired content. Need to get rid of old content if the new was not cachable for some reason. Members: src/client_side.c:1.708->1.709 Index: squid/src/client_side.c =================================================================== RCS file: /cvsroot/squid/squid/src/client_side.c,v retrieving revision 1.708 retrieving revision 1.709 diff -u -r1.708 -r1.709 --- squid/src/client_side.c 27 Feb 2007 01:06:12 -0000 1.708 +++ squid/src/client_side.c 27 Feb 2007 01:14:21 -0000 1.709 @@ -1,6 +1,6 @@ /* - * $Id: client_side.c,v 1.708 2007/02/27 01:06:12 hno Exp $ + * $Id: client_side.c,v 1.709 2007/02/27 01:14:21 hno Exp $ * * DEBUG: section 33 Client-side Routines * AUTHOR: Duane Wessels @@ -879,6 +879,12 @@ debug(33, 3) ("clientGetsOldEntry: YES, failure reply=%d\n", status); return 1; } + /* If the reply is not to a cache validation conditional then + * we should forward it to the client */ + if (!request->flags.cache_validation) { + debug(33, 5) ("clientGetsOldEntry: NO, not a cache validation\n"); + return 0; + } /* If the reply is anything but "Not Modified" then * we must forward it to the client */ if (HTTP_NOT_MODIFIED != status) { @@ -982,7 +988,7 @@ oldentry->mem_obj->request = requestLink(mem->request); unlink_request = 1; } - if (mem->reply->sline.status == HTTP_NOT_MODIFIED && http->request->flags.cache_validation) { + if (mem->reply->sline.status == HTTP_NOT_MODIFIED) { /* Don't memcpy() the whole reply structure here. For example, * www.thegist.com (Netscape/1.13) returns a content-length for * 304's which seems to be the length of the 304 HEADERS!!! and @@ -1009,6 +1015,9 @@ storeTimestampsSet(http->old_entry); http->log_type = LOG_TCP_REFRESH_HIT; } + /* Get rid of the old entry if not a cache validation */ + if (!http->request->flags.cache_validation) + storeRelease(http->old_entry); storeClientUnregister(http->old_sc, http->old_entry, http); storeUnlockObject(http->old_entry); recopy = 0;