]> git.sur5r.net Git - openldap/commitdiff
release lock as early as possible; deferring referral checking in searches may reduce...
authorPierangelo Masarati <ando@openldap.org>
Tue, 29 Mar 2005 23:56:23 +0000 (23:56 +0000)
committerPierangelo Masarati <ando@openldap.org>
Tue, 29 Mar 2005 23:56:23 +0000 (23:56 +0000)
servers/slapd/back-ldif/ldif.c

index e26affdae3ecc4d696454748d3a1ecf65fc58fe4..2dcb2e10fcd8823a972f09372cdd77835abc99ec 100644 (file)
@@ -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;
 }