]> git.sur5r.net Git - openldap/commitdiff
ITS#6103 send cancelled response back to client
authorHoward Chu <hyc@openldap.org>
Mon, 11 May 2009 04:16:57 +0000 (04:16 +0000)
committerHoward Chu <hyc@openldap.org>
Mon, 11 May 2009 04:16:57 +0000 (04:16 +0000)
servers/slapd/connection.c
servers/slapd/result.c

index bab511c586f098110b6dbd6371d68d1bdf6073b5..8791412da12560d6a186e63f9e583fd574c1e7b3 100644 (file)
@@ -1126,7 +1126,7 @@ operations_error:
        }
 
        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;
index e0800f4ffc59fb7c3256f692f7ab3ae58afbc0ea..c83cb22b63d83b23b6e3eb85be0962075b77fee1 100644 (file)
@@ -145,7 +145,7 @@ static long send_ldap_ber(
 
        /* 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;
        }
@@ -416,8 +416,12 @@ send_ldap_response(
        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 ) {