From 87ba3eb8b086748073ffdbb4fc6fff9a3966eef3 Mon Sep 17 00:00:00 2001 From: Pierangelo Masarati Date: Fri, 12 May 2006 19:25:31 +0000 Subject: [PATCH] refine previous commits (don't leave bindings around) --- servers/slapd/back-meta/bind.c | 4 +++- servers/slapd/back-meta/search.c | 10 ++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/servers/slapd/back-meta/bind.c b/servers/slapd/back-meta/bind.c index fd0539d7ad..05609f267b 100644 --- a/servers/slapd/back-meta/bind.c +++ b/servers/slapd/back-meta/bind.c @@ -571,7 +571,9 @@ retry:; mt, mc, candidate, LDAP_BACK_CONN_ISPRIV( mc ), LDAP_BACK_DONTSEND ); - LDAP_BACK_CONN_BINDING_SET( msc ); + if ( rc == LDAP_SUCCESS ) { + LDAP_BACK_CONN_BINDING_SET( msc ); + } } else { /* can't do anything about it */ diff --git a/servers/slapd/back-meta/search.c b/servers/slapd/back-meta/search.c index 8e8699438d..bc0010b81f 100644 --- a/servers/slapd/back-meta/search.c +++ b/servers/slapd/back-meta/search.c @@ -1229,6 +1229,16 @@ finish:; continue; } + if ( mc ) { + ldap_pvt_thread_mutex_lock( &mi->mi_conninfo.lai_mutex ); + if ( LDAP_BACK_CONN_BINDING( &mc->mc_conns[ i ] ) + && candidates[ i ].sr_msgid != META_MSGID_NEED_BIND ) + { + LDAP_BACK_CONN_BINDING_CLEAR( &mc->mc_conns[ i ] ); + } + ldap_pvt_thread_mutex_unlock( &mi->mi_conninfo.lai_mutex ); + } + if ( candidates[ i ].sr_matched ) { free( (char *)candidates[ i ].sr_matched ); candidates[ i ].sr_matched = NULL; -- 2.39.5