You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by mi...@apache.org on 2011/03/04 19:11:32 UTC

svn commit: r1078083 - /httpd/httpd/trunk/modules/cache/mod_cache_disk.c

Author: minfrin
Date: Fri Mar  4 18:11:32 2011
New Revision: 1078083

URL: http://svn.apache.org/viewvc?rev=1078083&view=rev
Log:
mod_cache_disk: Only attempt to commit to the initialisation if the attempt
to open the cache file was successful.

Modified:
    httpd/httpd/trunk/modules/cache/mod_cache_disk.c

Modified: httpd/httpd/trunk/modules/cache/mod_cache_disk.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/cache/mod_cache_disk.c?rev=1078083&r1=1078082&r2=1078083&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/cache/mod_cache_disk.c (original)
+++ httpd/httpd/trunk/modules/cache/mod_cache_disk.c Fri Mar  4 18:11:32 2011
@@ -432,8 +432,8 @@ static int open_entity(cache_handle_t *h
     }
 
     /* 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
             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;
     }