httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j..@apache.org
Subject svn commit: r660584 - in /httpd/httpd/branches/2.2.x: CHANGES STATUS modules/cache/cache_storage.c modules/cache/mod_cache.c
Date Tue, 27 May 2008 16:23:17 GMT
Author: jim
Date: Tue May 27 09:23:12 2008
New Revision: 660584

URL: http://svn.apache.org/viewvc?rev=660584&view=rev
Log:
Merge r636386, r636653 from trunk:

* Restore the original request headers if the cached resource was stale, as they
  may be needed by further output filters like the byterange filter to make the
  correct decisions.

PR: 44579


* Do not do Range requests if we use our own conditionals for validating
  a cache entity: If we get 304 the Range does not matter and otherwise the
  entity changed and we want to have the complete entity.

PR: 44579

Submitted by: rpluem
Reviewed by: jim

Modified:
    httpd/httpd/branches/2.2.x/CHANGES
    httpd/httpd/branches/2.2.x/STATUS
    httpd/httpd/branches/2.2.x/modules/cache/cache_storage.c
    httpd/httpd/branches/2.2.x/modules/cache/mod_cache.c

Modified: httpd/httpd/branches/2.2.x/CHANGES
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.2.x/CHANGES?rev=660584&r1=660583&r2=660584&view=diff
==============================================================================
--- httpd/httpd/branches/2.2.x/CHANGES [utf-8] (original)
+++ httpd/httpd/branches/2.2.x/CHANGES [utf-8] Tue May 27 09:23:12 2008
@@ -1,6 +1,9 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache 2.2.9
 
+  *) mod_cache: Handle If-Range correctly if the cached resource was stale.
+     PR 44579 [Ruediger Pluem]
+
   *) mod_proxy: Do not try a direct connection if the connection via a
      remote proxy failed before and the request has a request body.
      [Ruediger Pluem]

Modified: httpd/httpd/branches/2.2.x/STATUS
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.2.x/STATUS?rev=660584&r1=660583&r2=660584&view=diff
==============================================================================
--- httpd/httpd/branches/2.2.x/STATUS (original)
+++ httpd/httpd/branches/2.2.x/STATUS Tue May 27 09:23:12 2008
@@ -90,15 +90,6 @@
 PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
   [ start all new proposals below, under PATCHES PROPOSED. ]
 
- * mod_cache: Handle If-Range correctly if the cached resource was stale.
-   PR 44579
-   Trunk version of patch:
-         http://svn.apache.org/viewvc?rev=636386&view=rev
-         http://svn.apache.org/viewvc?rev=636653&view=rev
-   Backport version for 2.2.x of patch:
-         Trunk version of patch works
-   +1: rpluem, niq, jim
-
  * core: Do not allow Options ALL if not all options are allowed to be
    overwritten. PR 44262
    Trunk version of patch:

Modified: httpd/httpd/branches/2.2.x/modules/cache/cache_storage.c
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.2.x/modules/cache/cache_storage.c?rev=660584&r1=660583&r2=660584&view=diff
==============================================================================
--- httpd/httpd/branches/2.2.x/modules/cache/cache_storage.c (original)
+++ httpd/httpd/branches/2.2.x/modules/cache/cache_storage.c Tue May 27 09:23:12 2008
@@ -286,6 +286,13 @@
                 apr_table_unset(r->headers_in, "If-Range");
                 apr_table_unset(r->headers_in, "If-Unmodified-Since");
 
+                /*
+                 * Do not do Range requests with our own conditionals: If
+                 * we get 304 the Range does not matter and otherwise the
+                 * entity changed and we want to have the complete entity
+                 */
+                apr_table_unset(r->headers_in, "Range");
+
                 etag = apr_table_get(h->resp_hdrs, "ETag");
                 lastmod = apr_table_get(h->resp_hdrs, "Last-Modified");
 

Modified: httpd/httpd/branches/2.2.x/modules/cache/mod_cache.c
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.2.x/modules/cache/mod_cache.c?rev=660584&r1=660583&r2=660584&view=diff
==============================================================================
--- httpd/httpd/branches/2.2.x/modules/cache/mod_cache.c (original)
+++ httpd/httpd/branches/2.2.x/modules/cache/mod_cache.c Tue May 27 09:23:12 2008
@@ -613,6 +613,12 @@
             cache->provider->remove_entity(cache->stale_handle);
             /* Treat the request as if it wasn't conditional. */
             cache->stale_handle = NULL;
+            /*
+             * Restore the original request headers as they may be needed
+             * by further output filters like the byterange filter to make
+             * the correct decisions.
+             */
+            r->headers_in = cache->stale_headers;
         }
     }
 



Mime
View raw message