httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From minf...@apache.org
Subject svn commit: r1201332 - in /httpd/httpd/branches/2.4.x: CHANGES modules/cache/mod_cache.c
Date Sat, 12 Nov 2011 21:34:41 GMT
Author: minfrin
Date: Sat Nov 12 21:34:40 2011
New Revision: 1201332

URL: http://svn.apache.org/viewvc?rev=1201332&view=rev
Log:
Backport 1201331:
mod_cache: Make sure we merge headers correctly when we handle a
non cacheable conditional response. PR52120.

Modified:
    httpd/httpd/branches/2.4.x/CHANGES
    httpd/httpd/branches/2.4.x/modules/cache/mod_cache.c

Modified: httpd/httpd/branches/2.4.x/CHANGES
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/CHANGES?rev=1201332&r1=1201331&r2=1201332&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/CHANGES [utf-8] (original)
+++ httpd/httpd/branches/2.4.x/CHANGES [utf-8] Sat Nov 12 21:34:40 2011
@@ -1,6 +1,9 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache 2.4.0
 
+  *) mod_cache: Make sure we merge headers correctly when we handle a
+     non cacheable conditional response. PR52120. [Graham Leggett]
+
   *) Pre GA removal of components that will not be included:
      - mod_noloris was superseded by mod_reqtimeout
      - mod_serf

Modified: httpd/httpd/branches/2.4.x/modules/cache/mod_cache.c
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/modules/cache/mod_cache.c?rev=1201332&r1=1201331&r2=1201332&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/modules/cache/mod_cache.c (original)
+++ httpd/httpd/branches/2.4.x/modules/cache/mod_cache.c Sat Nov 12 21:34:40 2011
@@ -1081,6 +1081,20 @@ static int cache_save_filter(ap_filter_t
             APR_BRIGADE_INSERT_TAIL(bb, bkt);
         }
         else {
+            /* RFC 2616 10.3.5 states that entity headers are not supposed
+             * to be in the 304 response.  Therefore, we need to combine the
+             * response headers with the cached headers *before* we update
+             * the cached headers.
+             *
+             * However, before doing that, we need to first merge in
+             * err_headers_out and we also need to strip any hop-by-hop
+             * headers that might have snuck in.
+             */
+            r->headers_out = ap_cache_cacheable_headers_out(r);
+
+            /* Merge in our cached headers.  However, keep any updated values. */
+            cache_accept_headers(cache->handle, r, 1);
+
             cache->provider->recall_body(cache->handle, r->pool, bb);
 
             bkt = apr_bucket_eos_create(bb->bucket_alloc);



Mime
View raw message