From: Pierangelo Masarati Date: Fri, 12 May 2006 19:25:31 +0000 (+0000) Subject: refine previous commits (don't leave bindings around) X-Git-Tag: OPENLDAP_REL_ENG_2_4_1ALPHA~2^2~29 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=87ba3eb8b086748073ffdbb4fc6fff9a3966eef3;p=openldap refine previous commits (don't leave bindings around) --- 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;