From: Howard Chu Date: Mon, 11 May 2009 04:23:51 +0000 (+0000) Subject: Partially revert prev commit, leave rs->sr_err == SLAPD_ABANDON X-Git-Tag: ACLCHECK_0~561 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=9767c87531d193a4bef19286b77623aff18590fb;p=openldap Partially revert prev commit, leave rs->sr_err == SLAPD_ABANDON --- diff --git a/servers/slapd/connection.c b/servers/slapd/connection.c index 8791412da1..bab511c586 100644 --- a/servers/slapd/connection.c +++ b/servers/slapd/connection.c @@ -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; diff --git a/servers/slapd/result.c b/servers/slapd/result.c index c83cb22b63..63332dac17 100644 --- a/servers/slapd/result.c +++ b/servers/slapd/result.c @@ -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 ); }