]> granicus.if.org Git - apache/commitdiff
mod_disk_cache: When renegotiating an already cached Vary'd response, create
authorJustin Erenkrantz <jerenkrantz@apache.org>
Thu, 17 May 2007 16:10:29 +0000 (16:10 +0000)
committerJustin Erenkrantz <jerenkrantz@apache.org>
Thu, 17 May 2007 16:10:29 +0000 (16:10 +0000)
the refreshed .vary structure in the right directory.  Otherwise, we'll create
a new .vary layout underneath the already existing one - oops!

* modules/cache/mod_disk_cache.c
  (store_headers): Temporarily clear dobj->prefix if it is set to ensure that
  we create the .vary structure underneath the cache root.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@538992 13f79535-47bb-0310-9956-ffa450edef68

modules/cache/mod_disk_cache.c

index f89a65828a692cc8d0737444c3b13cc697c36f80..cb9047071d2a8a1b46e886e7980be6907c0f9d66 100644 (file)
@@ -841,6 +841,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,