From: Paul Querna Date: Thu, 21 Jul 2005 11:37:07 +0000 (+0000) Subject: Correctly restore the HTTP status from the cache handler. X-Git-Tag: 2.1.7~5^2~86 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f00dcbee2e12a52f6417f643ed5617a1d249b781;p=apache Correctly restore the HTTP status from the cache handler. Submitted by: Hansjoerg Pehofer git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@220036 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/CHANGES b/CHANGES index c69a902b6d..d8cb523903 100644 --- a/CHANGES +++ b/CHANGES @@ -2,6 +2,9 @@ Changes with Apache 2.1.7 [Remove entries to the current 2.0 section below, when backported] + *) mod_cache: Restore the HTTP status of cached responses. + [Hansjoerg Pehofer ] + *) mod_cache: Store varied contents all in the same prefix for a varied URI. [Paul Querna] diff --git a/modules/cache/mod_cache.c b/modules/cache/mod_cache.c index 10e61c8f29..be92bff5aa 100644 --- a/modules/cache/mod_cache.c +++ b/modules/cache/mod_cache.c @@ -200,6 +200,11 @@ static int cache_out_filter(ap_filter_t *f, apr_bucket_brigade *bb) ap_log_error(APLOG_MARK, APLOG_DEBUG, APR_SUCCESS, r->server, "cache: running CACHE_OUT filter"); + /* restore status of cached response */ + /* XXX: This exposes a bug in mem_cache, since it does not + * restore the status into it's handle. */ + r->status = cache->handle->status; + /* recall_headers() was called in cache_select_url() */ cache->provider->recall_body(cache->handle, r->pool, bb);