]> git.sur5r.net Git - openldap/commitdiff
ITS#5328 - do not send errors (other than referral) from be->be_chk_referrals()
authorHallvard Furuseth <hallvard@openldap.org>
Mon, 11 Feb 2008 20:59:40 +0000 (20:59 +0000)
committerHallvard Furuseth <hallvard@openldap.org>
Mon, 11 Feb 2008 20:59:40 +0000 (20:59 +0000)
servers/slapd/back-bdb/referral.c

index 97d7e1176ad33257703bbc8ed0f514abf7479e88..b2b2c68f5b11c6822b859b68838fc83d5265cb7c 100644 (file)
@@ -65,8 +65,8 @@ dn2entry_retry:
        case 0:
                break;
        case LDAP_BUSY:
-               send_ldap_error( op, rs, LDAP_BUSY, "ldap server busy" );
                LOCK_ID_FREE ( bdb->bi_dbenv, locker );
+               rs->sr_text = "ldap server busy";
                return LDAP_BUSY;
        case DB_LOCK_DEADLOCK:
        case DB_LOCK_NOTGRANTED:
@@ -76,13 +76,13 @@ dn2entry_retry:
                        LDAP_XSTRING(bdb_referrals)
                        ": dn2entry failed: %s (%d)\n",
                        db_strerror(rc), rc, 0 ); 
-               send_ldap_error( op, rs, LDAP_OTHER, "internal error" );
                LOCK_ID_FREE ( bdb->bi_dbenv, locker );
-               return rs->sr_err;
+               rs->sr_text = "internal error";
+               return LDAP_OTHER;
        }
 
        if ( rc == DB_NOTFOUND ) {
-               rc = 0;
+               rc = LDAP_SUCCESS;
                rs->sr_matched = NULL;
                if ( e != NULL ) {
                        Debug( LDAP_DEBUG_TRACE,
@@ -117,9 +117,7 @@ dn2entry_retry:
                        ber_bvarray_free( rs->sr_ref );
                        rs->sr_ref = NULL;
                } else if ( rc != LDAP_SUCCESS ) {
-                       rs->sr_err = rc;
                        rs->sr_text = rs->sr_matched ? "bad referral object" : NULL;
-                       send_ldap_result( op, rs );
                }
 
                LOCK_ID_FREE ( bdb->bi_dbenv, locker );
@@ -148,8 +146,8 @@ dn2entry_retry:
                        ber_bvarray_free( rs->sr_ref );
                        rs->sr_ref = NULL;
                } else {
-                       send_ldap_error( op, rs, LDAP_OTHER, "bad referral object" );
-                       rc = rs->sr_err;
+                       rc = LDAP_OTHER;
+                       rs->sr_text = "bad referral object";
                }
 
                rs->sr_matched = NULL;