]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
mod_disk_cache: Allow Vary'd content to be refreshed properly.
authorJustin Erenkrantz <jerenkrantz@apache.org>
Fri, 18 May 2007 06:09:53 +0000 (06:09 +0000)
committerJustin Erenkrantz <jerenkrantz@apache.org>
Fri, 18 May 2007 06:09:53 +0000 (06:09 +0000)
(Backport of r538992, r538997, r539054)

Reviewed by: jerenkrantz, fielding, rpluem

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

CHANGES
modules/cache/mod_disk_cache.c

diff --git a/CHANGES b/CHANGES
index d139a130149543bab647a6bf50335fc0169cfce4..eae49514480e48fe6479d079a300fa365787ef3c 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,9 @@
                                                         -*- coding: utf-8 -*-
 Changes with Apache 2.2.5
 
+  *) mod_disk_cache: Allow Vary'd responses to be refreshed properly.
+     [Justin Erenkrantz]
+
   *) mod_proxy: Print the correct error message for erroneous configured
      ProxyPass directives. PR 40439. [serai lans-tv.com]
 
index 92c5ad7501bf489a1113eccfc071d5f4eb81eedd..6b3e7733afc37bdff266c8e4cf62ea550017e146 100644 (file)
@@ -403,10 +403,6 @@ static int open_entity(cache_handle_t *h, request_rec *r, const char *key)
         len = sizeof(expire);
         apr_file_read_full(dobj->hfd, &expire, len, &len);
 
-        if (expire < r->request_time) {
-            return DECLINED;
-        }
-
         varray = apr_array_make(r->pool, 5, sizeof(char*));
         rc = read_array(r, varray, dobj->hfd);
         if (rc != APR_SUCCESS) {
@@ -823,6 +819,15 @@ static apr_status_t store_headers(cache_handle_t *h, request_rec *r, cache_info
             apr_array_header_t* varray;
             apr_uint32_t format = VARY_FORMAT_VERSION;
 
+            /* If we were initially opened as a vary format, rollback
+             * that internal state for the moment so we can recreate the
+             * vary format hints in the appropriate directory.
+             */
+            if (dobj->prefix) {
+                dobj->hdrsfile = dobj->prefix;
+                dobj->prefix = NULL;
+            }
+
             mkdir_structure(conf, dobj->hdrsfile, r->pool);
 
             rv = apr_file_mktemp(&dobj->tfd, dobj->tempfile,
@@ -875,8 +880,6 @@ static apr_status_t store_headers(cache_handle_t *h, request_rec *r, cache_info
         return rv;
     }
 
-    dobj->name = h->cache_obj->key;
-
     disk_info.format = DISK_FORMAT_VERSION;
     disk_info.date = info->date;
     disk_info.expire = info->expire;