Commit cef18472 authored by Justin Erenkrantz's avatar Justin Erenkrantz
Browse files

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
parent f5d0a95f
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -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,