From d35c89b1e019e869764e4f14db3ade88e156c27d Mon Sep 17 00:00:00 2001 From: Graham Leggett Date: Fri, 4 Mar 2011 18:11:32 +0000 Subject: [PATCH] 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 --- modules/cache/mod_cache_disk.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/modules/cache/mod_cache_disk.c b/modules/cache/mod_cache_disk.c index 11b66c308c5..4d5fef2a6c1 100644 --- a/modules/cache/mod_cache_disk.c +++ b/modules/cache/mod_cache_disk.c @@ -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; } -- 2.47.2