From c1150a199a080d99f58dd964d064acdf068e3cab Mon Sep 17 00:00:00 2001 From: Justin Erenkrantz Date: Thu, 17 May 2007 16:10:29 +0000 Subject: [PATCH] mod_disk_cache: When renegotiating an already cached Vary'd response, create 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 | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/modules/cache/mod_disk_cache.c b/modules/cache/mod_disk_cache.c index f89a65828a..cb9047071d 100644 --- a/modules/cache/mod_disk_cache.c +++ b/modules/cache/mod_disk_cache.c @@ -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, -- 2.40.0