From: Jim Jagielski Date: Tue, 4 Sep 2007 11:35:35 +0000 (+0000) Subject: Merge r481886 from trunk: X-Git-Tag: 2.2.6~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8da5b4c2e1ab513a826cdd874eb8c23587b6bc9f;p=thirdparty%2Fapache%2Fhttpd.git Merge r481886 from trunk: * Remove expired content from cache that cannot be revalidated. PR: 30370 Submitted by: rpluem Reviewed by: jim git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@572626 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/CHANGES b/CHANGES index d227a39cf44..633cd8ca430 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,9 @@ -*- coding: utf-8 -*- Changes with Apache 2.2.6 + *) mod_cache: Remove expired content from cache that cannot be revalidated. + PR 30370. [Ruediger Pluem] + *) mod_proxy_http: accept proxy-sendchunked/proxy-sendchunks as synonymous. PR 43183 [Brian Rectanus , Vincent Bray] diff --git a/STATUS b/STATUS index 2a0d71851cd..143049f21d9 100644 --- a/STATUS +++ b/STATUS @@ -80,14 +80,6 @@ PATCHES ACCEPTED TO BACKPORT FROM TRUNK: [ start all new proposals below, under PATCHES PROPOSED. ] - * mod_cache: Remove expired content from cache that cannot be revalidated. - PR 30370. - Trunk version of patch: - http://svn.apache.org/viewcvs.cgi?rev=481886&view=rev - Backport version for 2.2.x of patch: - Trunk version of patch works - +1: rpluem, fielding, jim - * mod_mem_cache: Increase the minimum and default value for MCacheMinObjectSize from 0 to 1, as a MCacheMinObjectSize of 0 does not make sense and leads to a signal Floating point exception (8) diff --git a/modules/cache/cache_storage.c b/modules/cache/cache_storage.c index f02f26f3ee0..0ddf82dd39f 100644 --- a/modules/cache/cache_storage.c +++ b/modules/cache/cache_storage.c @@ -304,6 +304,20 @@ int cache_select(request_rec *r) } cache->stale_handle = h; } + else { + int irv; + + /* + * The copy isn't fresh enough, but we cannot revalidate. + * So it is the same case as if there had not been a cached + * entry at all. Thus delete the entry from cache. + */ + irv = cache->provider->remove_url(h, r->pool); + if (irv != OK) { + ap_log_error(APLOG_MARK, APLOG_DEBUG, irv, r->server, + "cache: attempt to remove url from cache unsuccessful."); + } + } return DECLINED; }