]> git.sur5r.net Git - openldap/commitdiff
Delete dubious use of be_syncinfo - only the consumer can write the
authorHoward Chu <hyc@openldap.org>
Sat, 15 Jan 2005 10:39:23 +0000 (10:39 +0000)
committerHoward Chu <hyc@openldap.org>
Sat, 15 Jan 2005 10:39:23 +0000 (10:39 +0000)
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.)

servers/slapd/back-bdb/delete.c
servers/slapd/back-bdb/modify.c
servers/slapd/back-bdb/modrdn.c
servers/slapd/back-ldbm/delete.c
servers/slapd/back-ldbm/modify.c
servers/slapd/back-ldbm/modrdn.c

index 7eacf1fbc4790d45f9799240d9a3707da1dadc4d..f7b3ff494f9e4e71bb27c5ed837c356e4e5d9f99 100644 (file)
@@ -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;
index 9bdf51fde6298ade1ed3ede207a0e417025e7b18..db166d0c37acde5378a888c0fe272dad02ae79db 100644 (file)
@@ -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;
index 51e7399410d016ebbb9144fc550c2afafe37da17..333be33ee7b41d4e69f5386a8643794461641314 100644 (file)
@@ -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;
index 88e54935752e2f6686e62b82ceac4781ee8b11e0..7f1a4d5cb4d534dadedd5a4546c90271ad4009c0 100644 (file)
@@ -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;
index 725298b78dc08ce737250adc32a5aab2bc6eeecc..3e34178d209f796f1b97300d9e1dc52202a492e6 100644 (file)
@@ -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;
index 02039d4c9f1cd966111fd4f21db11af1a94141df..e9fd151fcc711fcd6d72ce043ca0b00ac08b9d8f 100644 (file)
@@ -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;