}
if ( op->o_cancel == SLAP_CANCEL_REQ ) {
- if ( rc == SLAPD_ABANDON ) {
+ if ( rc == SLAPD_ABANDON || rc == LDAP_CANCELLED ) {
op->o_cancel = SLAP_CANCEL_ACK;
} else {
op->o_cancel = LDAP_TOO_LATE;
/* write only one pdu at a time - wait til it's our turn */
ldap_pvt_thread_mutex_lock( &conn->c_write1_mutex );
- if ( op->o_abandon || connection_state_closing( conn )) {
+ if (( op->o_abandon && !op->o_cancel ) || connection_state_closing( conn )) {
ldap_pvt_thread_mutex_unlock( &conn->c_write1_mutex );
return 0;
}
long bytes;
if ( rs->sr_err == SLAPD_ABANDON || op->o_abandon ) {
- rc = SLAPD_ABANDON;
- goto clean2;
+ if ( op->o_cancel ) {
+ rs->sr_err = LDAP_CANCELLED;
+ } else {
+ rc = SLAPD_ABANDON;
+ goto clean2;
+ }
}
if ( op->o_callback ) {