]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Enable the option to support anonymous shared memory in mod_ldap. This makes the...
authorBradley Nicholes <bnicholes@apache.org>
Wed, 28 Jul 2004 20:05:50 +0000 (20:05 +0000)
committerBradley Nicholes <bnicholes@apache.org>
Wed, 28 Jul 2004 20:05:50 +0000 (20:05 +0000)
Reviewed by: minfrin, bnicholes, trawick

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/APACHE_2_0_BRANCH@104402 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
STATUS
docs/manual/mod/mod_ldap.xml
modules/experimental/util_ldap.c
modules/experimental/util_ldap_cache.c

diff --git a/CHANGES b/CHANGES
index e12381084f1908bd0608ccf95b03a640d4e06334..3e834950c485f62219a4395df513ffd2f1140733 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,5 +1,8 @@
 Changes with Apache 2.0.51
 
+  *) Enable the option to support anonymous shared memory in mod_ldap.
+     This makes the cache work on Linux again. [Graham Leggett]
+
   *) Enable special ErrorDocument value 'default' which restores the
      canned server response for the scope of the directive
      [Geoffrey Young, Andre Malo]
diff --git a/STATUS b/STATUS
index 5f0d0b2a82fc19a8fbd8a92549202e13ce63ad09..220b428fba2eda35a66896e1b7c1caaf7f7b14ae 100644 (file)
--- a/STATUS
+++ b/STATUS
@@ -1,5 +1,5 @@
 APACHE 2.0 STATUS:                                              -*-text-*-
-Last modified at [$Date: 2004/07/20 02:25:47 $]
+Last modified at [$Date: 2004/07/28 20:05:49 $]
 
 Release:
 
@@ -141,13 +141,6 @@ PATCHES TO BACKPORT FROM 2.1
          include/util_ldap.h r1.19
        +1: bnicholes
        
-    *) Enable the option to support anonymous shared memory in mod_ldap.
-       This makes the cache work on Linux again.
-         modules/experimental/util_ldap.c r1.30
-         modules/experimental/util_ldap_cache.c r1.17
-         docs/manual/mod/mod_ldap.xml r1.12
-       +1 minfrin, bnicholes, trawick
-
     *) Prevent Win32 pool corruption at startup
          server/mpm/winnt/child.c: r1.36 
        +1: ake, trawick, nd, stoddard
index 37a6ab1f400d7c42ae0fc8ca23fbace6316d97e7..6f744b69cdea1788f348b02dccd3167cd12450b3 100644 (file)
@@ -1,7 +1,7 @@
 <?xml version="1.0"?>
 <!DOCTYPE modulesynopsis SYSTEM "../style/modulesynopsis.dtd">
 <?xml-stylesheet type="text/xsl" href="../style/manual.en.xsl"?>
-<!-- $Revision: 1.3.2.7 $ -->
+<!-- $Revision: 1.3.2.8 $ -->
 
 <!--
  Copyright 2002-2004 The Apache Software Foundation
@@ -248,7 +248,8 @@ by other LDAP modules</description>
 
 <usage>
     <p>Specifies the directory path and file name of the shared memory
-    cache file. If not set, shared memory caching will not be used.</p>
+    cache file. If not set, anonymous shared memory will be used if the
+    platform supports it.</p>
 </usage>
 </directivesynopsis>
 
index 30c2ef12e318cab452e77ef6e6c818dae84c8657..417da4d1df8beac0dbc344a3961f3dee993f9b01 100644 (file)
@@ -1166,13 +1166,15 @@ static int util_ldap_post_config(apr_pool_t *p, apr_pool_t *plog,
     server_rec *s_vhost;
     util_ldap_state_t *st_vhost;
     
-    /* initializing cache if file is here and we already don't have shm addr*/
-    if (st->cache_file && !st->cache_shm) {
+    /* initializing cache if shared memory size is not zero and we already don't have shm address */
+    if (!st->cache_shm && st->cache_bytes > 0) {
 #endif
         result = util_ldap_cache_init(p, st);
-        apr_strerror(result, buf, sizeof(buf));
-        ap_log_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, result, s,
-                     "LDAP cache init: %s", buf);
+        if (result != APR_SUCCESS) {
+            apr_strerror(result, buf, sizeof(buf));
+            ap_log_error(APLOG_MARK, APLOG_ERR, result, s,
+                         "LDAP cache: error while creating a shared memory segment: %s", buf);
+        }
 
 #if APR_HAS_SHARED_MEMORY
         /* merge config in all vhost */
@@ -1190,7 +1192,7 @@ static int util_ldap_post_config(apr_pool_t *p, apr_pool_t *plog,
         }
     }
     else {
-        ap_log_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, 0 , s, "LDAP cache: Unable to init Shared Cache: no file");
+        ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s, "LDAP cache: LDAPSharedCacheSize is zero, disabling shared memory cache");
     }
 #endif
     
index c124df7240de67e6bbb4ae67fa3441b3b8d869a6..c1a1f1297fda893b1fd22c3162e87720c2f9051c 100644 (file)
@@ -267,12 +267,8 @@ apr_status_t util_ldap_cache_init(apr_pool_t *pool, util_ldap_state_t *st)
 #if APR_HAS_SHARED_MEMORY
     apr_status_t result;
 
-    if (!st->cache_file) {
-       return -1;
-    }
-
     result = apr_shm_create(&st->cache_shm, st->cache_bytes, st->cache_file, st->pool);
-    if (result == EEXIST) {
+    if (result == APR_EEXIST) {
         /*
          * The cache could have already been created (i.e. we may be a child process).  See
          * if we can attach to the existing shared memory