From: Pierangelo Masarati Date: Wed, 17 May 2006 01:34:46 +0000 (+0000) Subject: fix cleanup concurrency X-Git-Tag: OPENLDAP_REL_ENG_2_4_3ALPHA~9^2~250 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=9b388e5328d3b7b3838b11c7b22ae7828dccedc3;p=openldap fix cleanup concurrency --- diff --git a/servers/slapd/back-meta/bind.c b/servers/slapd/back-meta/bind.c index 9b654c7584..cd79a04ced 100644 --- a/servers/slapd/back-meta/bind.c +++ b/servers/slapd/back-meta/bind.c @@ -636,13 +636,21 @@ retry:; done:; rs->sr_err = rc; - if ( rc != LDAP_SUCCESS && META_BACK_ONERR_STOP( mi ) ) { + if ( rc != LDAP_SUCCESS ) { + if ( dolock ) { + ldap_pvt_thread_mutex_lock( &mi->mi_conninfo.lai_mutex ); + } LDAP_BACK_CONN_BINDING_CLEAR( msc ); - LDAP_BACK_CONN_TAINTED_SET( mc ); - meta_back_release_conn_lock( op, mc, dolock ); - *mcp = NULL; + if ( META_BACK_ONERR_STOP( mi ) ) { + LDAP_BACK_CONN_TAINTED_SET( mc ); + meta_back_release_conn_lock( op, mc, dolock ); + *mcp = NULL; + } + if ( dolock ) { + ldap_pvt_thread_mutex_unlock( &mi->mi_conninfo.lai_mutex ); + } - if ( sendok & LDAP_BACK_SENDERR ) { + if ( META_BACK_ONERR_STOP( mi ) && ( sendok & LDAP_BACK_SENDERR ) ) { send_ldap_result( op, rs ); } }