Commit 2ac85d15 authored by Graham Leggett's avatar Graham Leggett
Browse files

mod_cache_disk: Only attempt to commit to the initialisation if the attempt

to open the cache file was successful.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1078083 13f79535-47bb-0310-9956-ffa450edef68
parent b07316f4
Loading
Loading
Loading
Loading
+11 −2
Changes for modules/cache/mod_cache_disk.c: 11 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -432,8 +432,8 @@ static int open_entity(cache_handle_t *h, request_rec *r, const char *key)
    }

    /* Create and init the cache object */
    h->cache_obj = obj = apr_pcalloc(r->pool, sizeof(cache_object_t));
    obj->vobj = dobj = apr_pcalloc(r->pool, sizeof(disk_cache_object_t));
    obj = apr_pcalloc(r->pool, sizeof(cache_object_t));
    dobj = apr_pcalloc(r->pool, sizeof(disk_cache_object_t));

    info = &(obj->info);

@@ -570,11 +570,20 @@ static int open_entity(cache_handle_t *h, request_rec *r, const char *key)
            ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r,
                    "cache_disk: Recalled cached URL info header %s", dobj->name);

            /* make the configuration stick */
            h->cache_obj = obj;
            obj->vobj = dobj;

            return OK;
        }

    }
    else {

        /* make the configuration stick */
        h->cache_obj = obj;
        obj->vobj = dobj;

        return OK;
    }