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 2002/07/22 12:27:15 UTC

cvs commit: httpd-ldap/ldap-aaa mod_auth_ldap.c

minfrin     2002/07/22 03:27:14

  Modified:    ldap-aaa mod_auth_ldap.c
  Added:       .        CHANGES
  Log:
  Fix a resource leak where LDAP connections were not being returned
  to the pool after being used.
  Submitted by:	Scott Lamb <sl...@slamb.org>
  
  Revision  Changes    Path
  1.1                  httpd-ldap/CHANGES
  
  Index: CHANGES
  ===================================================================
  
    *) Fix a resource leak where LDAP connections were not being returned
       to the pool after being used. [Scott Lamb <sl...@slamb.org>]
  
  
  
  
  1.5       +10 -0     httpd-ldap/ldap-aaa/mod_auth_ldap.c
  
  Index: mod_auth_ldap.c
  ===================================================================
  RCS file: /home/cvs/httpd-ldap/ldap-aaa/mod_auth_ldap.c,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- mod_auth_ldap.c	18 May 2002 05:49:38 -0000	1.4
  +++ mod_auth_ldap.c	22 Jul 2002 10:27:14 -0000	1.5
  @@ -196,6 +196,13 @@
           strcat(filtbuf, "))");
   }
   
  +static apr_status_t mod_auth_ldap_cleanup_connection_close(void *param)
  +{
  +    util_ldap_connection_t *ldc = param;
  +    util_ldap_connection_close(ldc);
  +    return APR_SUCCESS;
  +}
  +
   
   /*
    * Authentication Phase
  @@ -361,6 +368,9 @@
           ldc = util_ldap_connection_find(r, sec->host, sec->port,
                                          sec->binddn, sec->bindpw, sec->deref,
                                          sec->netscapessl, sec->starttls);
  +        apr_pool_cleanup_register(r->pool, ldc,
  +                                  mod_auth_ldap_cleanup_connection_close,
  +                                  apr_pool_cleanup_null);
       }
       else {
           ap_log_rerror(APLOG_MARK, APLOG_WARNING|APLOG_NOERRNO, 0, r,