On Tue, 26 Apr 2011, Ruediger Pluem wrote:
On 04/25/2011 10:00 PM, s...@apache.org wrote:
Author: sf
Date: Mon Apr 25 20:00:43 2011
New Revision: 1096577

URL: http://svn.apache.org/viewvc?rev=1096577&view=rev
Log:
mod_ldap: Make LDAPSharedCacheSize 0 create a non-shared-memory cache per
process as opposed to disabling caching completely. This allows to use
the non-shared-memory cache as a workaround for the shared memory cache
not being available during graceful restarts

PR: 48958

Modified:
    httpd/httpd/trunk/CHANGES
    httpd/httpd/trunk/docs/manual/mod/mod_ldap.xml
    httpd/httpd/trunk/modules/ldap/util_ldap.c
    httpd/httpd/trunk/modules/ldap/util_ldap_cache.c
    httpd/httpd/trunk/modules/ldap/util_ldap_cache_mgr.c


Modified: httpd/httpd/trunk/modules/ldap/util_ldap_cache_mgr.c
URL: 
http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/ldap/util_ldap_cache_mgr.c?rev=1096577&r1=1096576&r2=1096577&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/ldap/util_ldap_cache_mgr.c (original)
+++ httpd/httpd/trunk/modules/ldap/util_ldap_cache_mgr.c Mon Apr 25 20:00:43 
2011

@@ -363,6 +366,14 @@ util_ald_cache_t *util_ald_create_cache(
     cache->nodes = (util_cache_node_t **)util_ald_alloc(cache, cache->size * 
sizeof(util_cache_node_t *));
     if (!cache->nodes) {
         util_ald_free(cache, cache);
+#if APR_HAS_SHARED_MEMORY
+        if (!st->cache_rmm)
+            free(cache);
+        else
+            apr_rmm_free(st->cache_rmm, block);
+#else
+        free(cache);

Do we ever alloc cache #if !APR_HAS_SHARED_MEMORY?

Yes, it's simply allocated with calloc. But my commit was wrong anyway, because the util_ald_free(cache, cache) in the line above already frees cache. Thanks for the review.

Cheers,
Stefan

Reply via email to