From 7d531d1416b92607c9fda05323e476d9ef494778 Mon Sep 17 00:00:00 2001 From: Pierangelo Masarati Date: Tue, 29 Mar 2005 23:56:23 +0000 Subject: [PATCH] release lock as early as possible; deferring referral checking in searches may reduce the amount of dynamic entry generation --- servers/slapd/back-ldif/ldif.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) 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; } -- 2.39.5