You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Scott Lamb <sl...@slamb.org> on 2002/07/19 20:43:24 UTC

[PATCH] Close connections in mod_auth_ldap #2

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, 

Re: [PATCH] Close connections in mod_auth_ldap #2

Posted by Graham Leggett <mi...@sharp.fm>.
Scott Lamb wrote:

> 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.

I have just committed your patch, but I cannot test it as the LDAP 
compile seems broken at the moment.

Regards,
Graham
-- 
-----------------------------------------
minfrin@sharp.fm 
	"There's a moon
					over Bourbon Street
						tonight..."