]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Merge r636386, r636653 from trunk:
authorJim Jagielski <jim@apache.org>
Tue, 27 May 2008 16:23:12 +0000 (16:23 +0000)
committerJim Jagielski <jim@apache.org>
Tue, 27 May 2008 16:23:12 +0000 (16:23 +0000)
* 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

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@660584 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
STATUS
modules/cache/cache_storage.c
modules/cache/mod_cache.c

diff --git a/CHANGES b/CHANGES
index b316b71e993d95ec2018e99ed547126ce50e07b6..ca09c80baecfed5a8be5cb87a008bbaba33bfe50 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -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]
diff --git a/STATUS b/STATUS
index 57f5cef16dd724bbfb1898678e7d6b4bf0e92d0e..98cd694394e940bbd3be583f5352a4d566bb45d7 100644 (file)
--- a/STATUS
+++ b/STATUS
@@ -90,15 +90,6 @@ RELEASE SHOWSTOPPERS:
 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:
index 0ddf82dd39f0a2f9c6c2a5df8d2de6efdfe22e08..7b99f3eda9132c59ad3a062c5b158a21d7b66369 100644 (file)
@@ -286,6 +286,13 @@ int cache_select(request_rec *r)
                 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");
 
index 51341179f99ce2e3a1c3daf5a77996e5f9921bcb..27df70d436bbb48f317ffe5a1eee27b1adaa68f8 100644 (file)
@@ -613,6 +613,12 @@ static int cache_save_filter(ap_filter_t *f, apr_bucket_brigade *in)
             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;
         }
     }