/* get entry with writer lock */
e = dn2entry_w( op->o_bd, &op->o_req_ndn, &matched );
-#ifdef LDAP_SYNCREPL /* FIXME : dn2entry() should return non-glue entry */
+ /* FIXME : dn2entry() should return non-glue entry */
if ( e == NULL || ( !manageDSAit && is_entry_glue( e ))) {
-#else
- if ( e == NULL ) {
-#endif
#ifdef NEW_LOGGING
LDAP_LOG( BACK_LDBM, INFO,
"ldbm_back_delete: no such object %s\n", op->o_req_dn.bv_val, 0, 0 );
cache_return_entry_r( &li->li_cache, matched );
} else {
-#ifdef LDAP_SYNCREPL
- BerVarray deref = op->o_bd->syncinfo ?
- op->o_bd->syncinfo->provideruri_bv : default_referral;
-#else
- BerVarray deref = default_referral;
-#endif
- rs->sr_ref = referral_rewrite( deref, NULL, &op->o_req_dn, LDAP_SCOPE_DEFAULT );
+ BerVarray deref = NULL;
+ if ( !LDAP_STAILQ_EMPTY( &op->o_bd->be_syncinfo )) {
+ syncinfo_t *si;
+ LDAP_STAILQ_FOREACH( si, &op->o_bd->be_syncinfo, si_next ) {
+ struct berval tmpbv;
+ ber_dupbv( &tmpbv, &si->si_provideruri_bv[0] );
+ ber_bvarray_add( &deref, &tmpbv );
+ }
+ } else {
+ deref = default_referral;
+ }
+ rs->sr_ref = referral_rewrite( deref, NULL, &op->o_req_dn,
+ LDAP_SCOPE_DEFAULT );
}
ldap_pvt_thread_rdwr_wunlock(&li->li_giant_rwlock);
if ( rs->sr_ref ) ber_bvarray_free( rs->sr_ref );
free( (char *)rs->sr_matched );
-
+ rs->sr_ref = NULL;
+ rs->sr_matched = NULL;
return( -1 );
}
send_ldap_result( op, rs );
if ( rs->sr_ref ) ber_bvarray_free( rs->sr_ref );
-
+ rs->sr_ref = NULL;
+ rs->sr_matched = NULL;
rc = LDAP_REFERRAL;
goto return_results;
}