You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by bn...@apache.org on 2004/07/28 22:05:50 UTC

cvs commit: httpd-2.0/modules/experimental util_ldap.c util_ldap_cache.c

bnicholes    2004/07/28 13:05:50

  Modified:    .        Tag: APACHE_2_0_BRANCH CHANGES STATUS
               docs/manual/mod Tag: APACHE_2_0_BRANCH mod_ldap.xml
               modules/experimental Tag: APACHE_2_0_BRANCH util_ldap.c
                        util_ldap_cache.c
  Log:
  Enable the option to support anonymous shared memory in mod_ldap. This makes the cache work on Linux again.
  
  Reviewed by: minfrin, bnicholes, trawick
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.988.2.315 +3 -0      httpd-2.0/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/CHANGES,v
  retrieving revision 1.988.2.314
  retrieving revision 1.988.2.315
  diff -u -r1.988.2.314 -r1.988.2.315
  --- CHANGES	12 Jul 2004 17:03:18 -0000	1.988.2.314
  +++ CHANGES	28 Jul 2004 20:05:48 -0000	1.988.2.315
  @@ -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]
  
  
  
  1.751.2.960 +1 -8      httpd-2.0/STATUS
  
  Index: STATUS
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/STATUS,v
  retrieving revision 1.751.2.959
  retrieving revision 1.751.2.960
  diff -u -r1.751.2.959 -r1.751.2.960
  --- STATUS	20 Jul 2004 02:25:47 -0000	1.751.2.959
  +++ STATUS	28 Jul 2004 20:05:49 -0000	1.751.2.960
  @@ -141,13 +141,6 @@
            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
  
  
  
  No                   revision
  No                   revision
  1.3.2.8   +3 -2      httpd-2.0/docs/manual/mod/mod_ldap.xml
  
  Index: mod_ldap.xml
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/docs/manual/mod/mod_ldap.xml,v
  retrieving revision 1.3.2.7
  retrieving revision 1.3.2.8
  diff -u -r1.3.2.7 -r1.3.2.8
  --- mod_ldap.xml	17 Apr 2004 18:43:37 -0000	1.3.2.7
  +++ mod_ldap.xml	28 Jul 2004 20:05:50 -0000	1.3.2.8
  @@ -248,7 +248,8 @@
   
   <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>
   
  
  
  
  No                   revision
  No                   revision
  1.6.2.18  +8 -6      httpd-2.0/modules/experimental/util_ldap.c
  
  Index: util_ldap.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/experimental/util_ldap.c,v
  retrieving revision 1.6.2.17
  retrieving revision 1.6.2.18
  diff -u -r1.6.2.17 -r1.6.2.18
  --- util_ldap.c	11 Jun 2004 16:15:43 -0000	1.6.2.17
  +++ util_ldap.c	28 Jul 2004 20:05:50 -0000	1.6.2.18
  @@ -1166,13 +1166,15 @@
       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 @@
           }
       }
       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
       
  
  
  
  1.6.2.8   +1 -5      httpd-2.0/modules/experimental/util_ldap_cache.c
  
  Index: util_ldap_cache.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/experimental/util_ldap_cache.c,v
  retrieving revision 1.6.2.7
  retrieving revision 1.6.2.8
  diff -u -r1.6.2.7 -r1.6.2.8
  --- util_ldap_cache.c	21 May 2004 23:49:09 -0000	1.6.2.7
  +++ util_ldap_cache.c	28 Jul 2004 20:05:50 -0000	1.6.2.8
  @@ -267,12 +267,8 @@
   #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