]> granicus.if.org Git - apache/commitdiff
Centralize the error-header collapsing done when sending out cached replies. Mark...
authorDirk-Willem van Gulik <dirkx@apache.org>
Fri, 18 Apr 2008 11:05:25 +0000 (11:05 +0000)
committerDirk-Willem van Gulik <dirkx@apache.org>
Fri, 18 Apr 2008 11:05:25 +0000 (11:05 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@649460 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
modules/cache/cache_util.c
modules/cache/mod_cache.c

diff --git a/CHANGES b/CHANGES
index 68c6a8439f21597b78a51d0238afdcdce00a145b..58ca77c3cce79c9c6905da1d4717b8d026b7a5b1 100644 (file)
--- 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
index 615823a1e68dda06eb158e8b902506c7bcf18630..d8dc1fdd63fc0f4ea10e0d87a07ae7e4d3b3a33c 100644 (file)
@@ -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;
 }
index 8212d63fdacfcdd9e9842b513d867a7d7a6abce4..945adb6b7b5154c39c074d341a706ba56d149ccf 100644 (file)
@@ -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);