mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-03-07 14:18:15 +08:00
ITS#7740 back-meta: avoid blocking other threads
Don't lock other threads while trying to connect to remote node.
This commit is contained in:
parent
ed09222963
commit
66e0d6017a
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user