Commit 1dbe92c2 authored by Howard Chu's avatar Howard Chu
Browse files

Delete dubious use of be_syncinfo - only the consumer can write the

database, and it will only perform writes it received from the provider,
so referring back to the provider is pointless. (And of course, the
consumer never chases referrals.)
parent 8d0f39bb
......@@ -148,8 +148,6 @@ retry: /* transaction retry */
/* FIXME : dn2entry() should return non-glue entry */
if ( e == NULL || ( !manageDSAit && is_entry_glue( e ))) {
BerVarray deref = NULL;
Debug( LDAP_DEBUG_ARGS,
"<=- " LDAP_XSTRING(bdb_delete) ": no such object %s\n",
op->o_req_dn.bv_val, 0, 0);
......@@ -163,18 +161,8 @@ retry: /* transaction retry */
matched = NULL;
} else {
if ( op->o_bd->be_syncinfo ) {
syncinfo_t *si = op->o_bd->be_syncinfo;
{
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 );
rs->sr_ref = referral_rewrite( default_referral, NULL,
&op->o_req_dn, LDAP_SCOPE_DEFAULT );
}
rs->sr_err = LDAP_REFERRAL;
......@@ -183,9 +171,6 @@ retry: /* transaction retry */
if ( rs->sr_ref != default_referral ) {
ber_bvarray_free( rs->sr_ref );
}
if ( deref != default_referral ) {
ber_bvarray_free( deref );
}
free( (char *)rs->sr_matched );
rs->sr_ref = NULL;
rs->sr_matched = NULL;
......
......@@ -372,7 +372,6 @@ retry: /* transaction retry */
if (( rs->sr_err == DB_NOTFOUND ) ||
( !manageDSAit && e && is_entry_glue( e )))
{
BerVarray deref = NULL;
if ( e != NULL ) {
rs->sr_matched = ch_strdup( e->e_dn );
rs->sr_ref = is_entry_referral( e )
......@@ -382,18 +381,8 @@ retry: /* transaction retry */
e = NULL;
} else {
if ( op->o_bd->be_syncinfo ) {
syncinfo_t *si = op->o_bd->be_syncinfo;
{
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 );
rs->sr_ref = referral_rewrite( default_referral, NULL,
&op->o_req_dn, LDAP_SCOPE_DEFAULT );
}
rs->sr_err = LDAP_REFERRAL;
......@@ -402,9 +391,6 @@ retry: /* transaction retry */
if ( rs->sr_ref != default_referral ) {
ber_bvarray_free( rs->sr_ref );
}
if ( deref != default_referral ) {
ber_bvarray_free( deref );
}
free( (char *)rs->sr_matched );
rs->sr_ref = NULL;
rs->sr_matched = NULL;
......
......@@ -163,7 +163,6 @@ retry: /* transaction retry */
if (( rs->sr_err == DB_NOTFOUND ) ||
( !manageDSAit && e && is_entry_glue( e )))
{
BerVarray deref = NULL;
if( e != NULL ) {
rs->sr_matched = ch_strdup( e->e_dn );
rs->sr_ref = is_entry_referral( e )
......@@ -173,27 +172,14 @@ retry: /* transaction retry */
e = NULL;
} else {
if ( op->o_bd->be_syncinfo ) {
syncinfo_t *si = op->o_bd->be_syncinfo;
{
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 );
rs->sr_ref = referral_rewrite( default_referral, NULL,
&op->o_req_dn, LDAP_SCOPE_DEFAULT );
}
rs->sr_err = LDAP_REFERRAL;
send_ldap_result( op, rs );
ber_bvarray_free( rs->sr_ref );
if ( deref != default_referral ) {
ber_bvarray_free( deref );
}
free( (char *)rs->sr_matched );
rs->sr_ref = NULL;
rs->sr_matched = NULL;
......
......@@ -49,8 +49,6 @@ ldbm_back_delete(
/* FIXME : dn2entry() should return non-glue entry */
if ( e == NULL || ( !manageDSAit && is_entry_glue( e ))) {
BerVarray deref = NULL;
Debug(LDAP_DEBUG_ARGS, "<=- ldbm_back_delete: no such object %s\n",
op->o_req_dn.bv_val, 0, 0);
......@@ -62,18 +60,8 @@ ldbm_back_delete(
cache_return_entry_r( &li->li_cache, matched );
} else {
if ( op->o_bd->be_syncinfo ) {
syncinfo_t *si = op->o_bd->be_syncinfo;
{
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 );
rs->sr_ref = referral_rewrite( default_referral, NULL,
&op->o_req_dn, LDAP_SCOPE_DEFAULT );
}
ldap_pvt_thread_rdwr_wunlock(&li->li_giant_rwlock);
......@@ -82,9 +70,6 @@ ldbm_back_delete(
send_ldap_result( op, rs );
if ( rs->sr_ref ) ber_bvarray_free( rs->sr_ref );
if ( deref != default_referral ) {
ber_bvarray_free( deref );
}
free( (char *)rs->sr_matched );
rs->sr_ref = NULL;
rs->sr_matched = NULL;
......
......@@ -249,7 +249,6 @@ ldbm_back_modify(
/* FIXME: dn2entry() should return non-glue entry */
if (( e == NULL ) || ( !manageDSAit && e && is_entry_glue( e ))) {
BerVarray deref = NULL;
if ( matched != NULL ) {
rs->sr_matched = ch_strdup( matched->e_dn );
rs->sr_ref = is_entry_referral( matched )
......@@ -257,18 +256,8 @@ ldbm_back_modify(
: NULL;
cache_return_entry_r( &li->li_cache, matched );
} else {
if ( op->o_bd->be_syncinfo ) {
syncinfo_t *si = op->o_bd->be_syncinfo;
{
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 );
rs->sr_ref = referral_rewrite( default_referral, NULL,
&op->o_req_dn, LDAP_SCOPE_DEFAULT );
}
ldap_pvt_thread_rdwr_wunlock(&li->li_giant_rwlock);
......@@ -276,9 +265,6 @@ ldbm_back_modify(
send_ldap_result( op, rs );
if ( rs->sr_ref ) ber_bvarray_free( rs->sr_ref );
if ( deref != default_referral ) {
ber_bvarray_free( deref );
}
free( (char *)rs->sr_matched );
rs->sr_ref = NULL;
......
......@@ -77,7 +77,6 @@ ldbm_back_modrdn(
/* get entry with writer lock */
/* FIXME: dn2entry() should return non-glue entry */
if (( e == NULL ) || ( !manageDSAit && e && is_entry_glue( e ))) {
BerVarray deref = NULL;
if ( matched != NULL ) {
rs->sr_matched = strdup( matched->e_dn );
rs->sr_ref = is_entry_referral( matched )
......@@ -85,18 +84,8 @@ ldbm_back_modrdn(
: NULL;
cache_return_entry_r( &li->li_cache, matched );
} else {
if ( op->o_bd->be_syncinfo ) {
syncinfo_t *si = op->o_bd->be_syncinfo;
{
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 );
rs->sr_ref = referral_rewrite( default_referral, NULL,
&op->o_req_dn, LDAP_SCOPE_DEFAULT );
}
ldap_pvt_thread_rdwr_wunlock(&li->li_giant_rwlock);
......@@ -105,9 +94,6 @@ ldbm_back_modrdn(
send_ldap_result( op, rs );
if ( rs->sr_ref ) ber_bvarray_free( rs->sr_ref );
if ( deref != default_referral ) {
ber_bvarray_free( deref );
}
free( (char *)rs->sr_matched );
rs->sr_ref = NULL;
rs->sr_matched = NULL;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment