]> git.sur5r.net Git - openldap/commitdiff
Partially revert prev commit, leave rs->sr_err == SLAPD_ABANDON
authorHoward Chu <hyc@openldap.org>
Mon, 11 May 2009 04:23:51 +0000 (04:23 +0000)
committerHoward Chu <hyc@openldap.org>
Mon, 11 May 2009 04:23:51 +0000 (04:23 +0000)
servers/slapd/connection.c
servers/slapd/result.c

index 8791412da12560d6a186e63f9e583fd574c1e7b3..bab511c586f098110b6dbd6371d68d1bdf6073b5 100644 (file)
@@ -1126,7 +1126,7 @@ operations_error:
        }
 
        if ( op->o_cancel == SLAP_CANCEL_REQ ) {
-               if ( rc == SLAPD_ABANDON || rc == LDAP_CANCELLED ) {
+               if ( rc == SLAPD_ABANDON ) {
                        op->o_cancel = SLAP_CANCEL_ACK;
                } else {
                        op->o_cancel = LDAP_TOO_LATE;
index c83cb22b63d83b23b6e3eb85be0962075b77fee1..63332dac17f646d354966dd90f97278bf3c70c6b 100644 (file)
@@ -415,13 +415,9 @@ send_ldap_response(
        int             rc = LDAP_SUCCESS;
        long    bytes;
 
-       if ( rs->sr_err == SLAPD_ABANDON || op->o_abandon ) {
-               if ( op->o_cancel ) {
-                       rs->sr_err = LDAP_CANCELLED;
-               } else {
-                       rc = SLAPD_ABANDON;
-                       goto clean2;
-               }
+       if (( rs->sr_err == SLAPD_ABANDON || op->o_abandon ) && !op->o_cancel ) {
+               rc = SLAPD_ABANDON;
+               goto clean2;
        }
 
        if ( op->o_callback ) {
@@ -441,9 +437,13 @@ send_ldap_response(
                ber_set_option( ber, LBER_OPT_BER_MEMCTX, &op->o_tmpmemctx );
        }
 
+       rc = rs->sr_err;
+       if ( rc == SLAPD_ABANDON && op->o_cancel )
+               rc = LDAP_CANCELLED;
+
        Debug( LDAP_DEBUG_TRACE,
                "send_ldap_response: msgid=%d tag=%lu err=%d\n",
-               rs->sr_msgid, rs->sr_tag, rs->sr_err );
+               rs->sr_msgid, rs->sr_tag, rc );
 
        if( rs->sr_ref ) {
                Debug( LDAP_DEBUG_ARGS, "send_ldap_response: ref=\"%s\"\n",
@@ -467,7 +467,7 @@ send_ldap_response(
 
        } else {
            rc = ber_printf( ber, "{it{ess" /*"}}"*/,
-               rs->sr_msgid, rs->sr_tag, rs->sr_err,
+               rs->sr_msgid, rs->sr_tag, rc,
                rs->sr_matched == NULL ? "" : rs->sr_matched,
                rs->sr_text == NULL ? "" : rs->sr_text );
        }