]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
mod_cache_disk: Only attempt to commit to the initialisation if the attempt
authorGraham Leggett <minfrin@apache.org>
Fri, 4 Mar 2011 18:11:32 +0000 (18:11 +0000)
committerGraham Leggett <minfrin@apache.org>
Fri, 4 Mar 2011 18:11:32 +0000 (18:11 +0000)
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

index 11b66c308c55291dc79ff2973ff47e93584994e9..4d5fef2a6c1117163522ce1d270867e41ba42ebe 100644 (file)
@@ -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;
     }