You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by je...@apache.org on 2007/05/18 08:09:54 UTC

svn commit: r539279 - in /httpd/httpd/branches/2.2.x: CHANGES modules/cache/mod_disk_cache.c

Author: jerenkrantz
Date: Thu May 17 23:09:53 2007
New Revision: 539279

URL: http://svn.apache.org/viewvc?view=rev&rev=539279
Log:
mod_disk_cache: Allow Vary'd content to be refreshed properly.

(Backport of r538992, r538997, r539054)

Reviewed by: jerenkrantz, fielding, rpluem

Modified:
    httpd/httpd/branches/2.2.x/CHANGES
    httpd/httpd/branches/2.2.x/modules/cache/mod_disk_cache.c

Modified: httpd/httpd/branches/2.2.x/CHANGES
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.2.x/CHANGES?view=diff&rev=539279&r1=539278&r2=539279
==============================================================================
--- httpd/httpd/branches/2.2.x/CHANGES [utf-8] (original)
+++ httpd/httpd/branches/2.2.x/CHANGES [utf-8] Thu May 17 23:09:53 2007
@@ -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]
 

Modified: httpd/httpd/branches/2.2.x/modules/cache/mod_disk_cache.c
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.2.x/modules/cache/mod_disk_cache.c?view=diff&rev=539279&r1=539278&r2=539279
==============================================================================
--- httpd/httpd/branches/2.2.x/modules/cache/mod_disk_cache.c (original)
+++ httpd/httpd/branches/2.2.x/modules/cache/mod_disk_cache.c Thu May 17 23:09:53 2007
@@ -403,10 +403,6 @@
         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 @@
             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,
@@ -874,8 +879,6 @@
     if (rv != APR_SUCCESS) {
         return rv;
     }
-
-    dobj->name = h->cache_obj->key;
 
     disk_info.format = DISK_FORMAT_VERSION;
     disk_info.date = info->date;