Commit 374c25c4 authored by Jorge Perez Burgos's avatar Jorge Perez Burgos Committed by Quanah Gibson-Mount
Browse files

ITS#7740 back-meta: avoid blocking other threads

Don't lock other threads while trying to connect to remote node.
parent d6fcda4c
......@@ -618,6 +618,10 @@ meta_back_single_dobind(
/* FIXME: should we check if at least some of the op->o_ctrls
* can/should be passed? */
if(!dolock) {
ldap_pvt_thread_mutex_unlock( &mi->mi_conninfo.lai_mutex );
}
for (;;) {
rs->sr_err = ldap_sasl_bind( msc->msc_ld,
binddn, LDAP_SASL_SIMPLE, &cred,
......@@ -628,6 +632,10 @@ meta_back_single_dobind(
ldap_pvt_thread_yield();
}
if(!dolock) {
ldap_pvt_thread_mutex_lock( &mi->mi_conninfo.lai_mutex );
}
rs->sr_err = meta_back_bind_op_result( op, rs, mc, candidate, msgid, sendok, dolock );
/* if bind succeeded, but anonymous, clear msc_bound_ndn */
......@@ -1578,6 +1586,11 @@ meta_back_proxy_authz_bind(
switch ( method ) {
case LDAP_AUTH_NONE:
case LDAP_AUTH_SIMPLE:
if(!dolock) {
ldap_pvt_thread_mutex_unlock( &mi->mi_conninfo.lai_mutex );
}
for (;;) {
rs->sr_err = ldap_sasl_bind( msc->msc_ld,
binddn.bv_val, LDAP_SASL_SIMPLE,
......@@ -1587,6 +1600,11 @@ meta_back_proxy_authz_bind(
}
ldap_pvt_thread_yield();
}
if(!dolock) {
ldap_pvt_thread_mutex_lock( &mi->mi_conninfo.lai_mutex );
}
rc = meta_back_bind_op_result( op, rs, mc, candidate, msgid, sendok, dolock );
if ( rc == LDAP_SUCCESS ) {
/* set rebind stuff in case of successful proxyAuthz bind,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment