From b3c481970a1832f6088af167049e8353990816d1 Mon Sep 17 00:00:00 2001 From: Dirk-Willem van Gulik Date: Fri, 18 Apr 2008 11:05:25 +0000 Subject: [PATCH] Centralize the error-header collapsing done when sending out cached replies. Mark the change in CHANGES as it may have unforseen fall out and/or may need to be reverted or done more subtle. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@649460 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 5 +++++ modules/cache/cache_util.c | 8 +++++--- modules/cache/mod_cache.c | 10 +--------- 3 files changed, 11 insertions(+), 12 deletions(-) diff --git a/CHANGES b/CHANGES index 68c6a8439f..58ca77c3cc 100644 --- a/CHANGES +++ b/CHANGES @@ -2,6 +2,11 @@ Changes with Apache 2.3.0 [ When backported to 2.2.x, remove entry from this file ] + *) ap_cache_cacheable_headers_out() will (now) always + merge an error heaeders _before_ clearing them and _before_ + merging in the actual entity headers and doing normal + hop-by-hop cleansing. [Dirk-Willem van Gulik]. + *) cache: retire ap_cache_cacheable_hdrs_out() which was used for both in- and out-put headers; and replace it by a single ap_cache_cacheable_headers() wrapped in a in- and out-put diff --git a/modules/cache/cache_util.c b/modules/cache/cache_util.c index 615823a1e6..d8dc1fdd63 100644 --- a/modules/cache/cache_util.c +++ b/modules/cache/cache_util.c @@ -654,6 +654,11 @@ CACHE_DECLARE(apr_table_t *)ap_cache_cacheable_headers_out(request_rec * r) { apr_table_t *headers_out; + headers_out = apr_table_overlay(r->pool, headers_out, + r->err_headers_out); + + apr_table_clear(r->err_headers_out); + headers_out = ap_cache_cacheable_headers(r->pool, r->headers_out, r->server); @@ -663,8 +668,5 @@ CACHE_DECLARE(apr_table_t *)ap_cache_cacheable_headers_out(request_rec * r) ap_make_content_type(r, r->content_type)); } - headers_out = apr_table_overlay(r->pool, headers_out, - r->err_headers_out); - return headers_out; } diff --git a/modules/cache/mod_cache.c b/modules/cache/mod_cache.c index 8212d63fda..945adb6b7b 100644 --- a/modules/cache/mod_cache.c +++ b/modules/cache/mod_cache.c @@ -757,15 +757,7 @@ static int cache_save_filter(ap_filter_t *f, apr_bucket_brigade *in) * err_headers_out and we also need to strip any hop-by-hop * headers that might have snuck in. */ - r->headers_out = apr_table_overlay(r->pool, r->headers_out, - r->err_headers_out); - - /* XXX check -- we're not patching up content-type - i.e. this - * propably should be ap_cache_cacheable_headers_out(). - */ - r->headers_out = ap_cache_cacheable_headers(r->pool, r->headers_out, - r->server); - apr_table_clear(r->err_headers_out); + r->headers_out = ap_cache_cacheable_headers_out(r); /* Merge in our cached headers. However, keep any updated values. */ ap_cache_accept_headers(cache->handle, r, 1); -- 2.40.0