From: Pierangelo Masarati Date: Tue, 29 Mar 2005 23:56:23 +0000 (+0000) Subject: release lock as early as possible; deferring referral checking in searches may reduce... X-Git-Tag: OPENLDAP_AC_BP~1041 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=7d531d1416b92607c9fda05323e476d9ef494778;p=openldap release lock as early as possible; deferring referral checking in searches may reduce the amount of dynamic entry generation --- diff --git a/servers/slapd/back-ldif/ldif.c b/servers/slapd/back-ldif/ldif.c index e26affdae3..2dcb2e10fc 100644 --- a/servers/slapd/back-ldif/ldif.c +++ b/servers/slapd/back-ldif/ldif.c @@ -598,6 +598,8 @@ ldif_back_referrals( Operation *op, SlapReply *rs ) entry = (Entry *)get_entry( op, &ni->li_base_path ); } + ldap_pvt_thread_mutex_unlock( &ni->li_mutex ); + op->o_req_dn = odn; op->o_req_ndn = ondn; @@ -643,12 +645,11 @@ ldif_back_referrals( Operation *op, SlapReply *rs ) rs->sr_matched = NULL; } - ldap_pvt_thread_mutex_unlock( &ni->li_mutex ); - return rc; - } + ldap_pvt_thread_mutex_unlock( &ni->li_mutex ); + if ( is_entry_referral( entry ) ) { /* entry is a referral */ BerVarray refs = get_entry_referrals( op, entry ); @@ -677,8 +678,6 @@ ldif_back_referrals( Operation *op, SlapReply *rs ) entry_free( entry ); } - ldap_pvt_thread_mutex_unlock( &ni->li_mutex ); - return rc; }