httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Scott Lamb <sl...@slamb.org>
Subject [PATCH] Close connections in mod_auth_ldap #2
Date Fri, 19 Jul 2002 18:43:24 GMT
On Fri, Jul 19, 2002 at 08:09:46AM +0200, Graham Leggett wrote:
> I would imagine you would just register the cleanup in the request pool 
> r->pool. I assume that *_auth_checker only gets run once per request, so 
> the request pool would make the most sense.

Okay, now I understand what you are saying. Here's a patch that should
do that. It seems to solve my problem and is definitely cleaner than my
last patch.

-- 
Scott Lamb



Index: modules/httpd-ldap/ldap-aaa/mod_auth_ldap.c
===================================================================
RCS file: /home/cvspublic/httpd-ldap/ldap-aaa/mod_auth_ldap.c,v
retrieving revision 1.4
diff -u -r1.4 mod_auth_ldap.c
--- modules/httpd-ldap/ldap-aaa/mod_auth_ldap.c	18 May 2002 05:49:38 -0000	1.4
+++ modules/httpd-ldap/ldap-aaa/mod_auth_ldap.c	19 Jul 2002 18:40:20 -0000
@@ -311,6 +311,13 @@
     return OK;
 }
 
+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;
+}
+
 
 /*
  * Authorisation 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, 

Mime
View raw message