From: Howard Chu Date: Mon, 11 May 2009 04:16:57 +0000 (+0000) Subject: ITS#6103 send cancelled response back to client X-Git-Tag: ACLCHECK_0~562 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=2889cc9b1d2b38c098ae3cb86fc95668f2bdb32e;p=openldap ITS#6103 send cancelled response back to client --- diff --git a/servers/slapd/connection.c b/servers/slapd/connection.c index bab511c586..8791412da1 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 ) { + if ( rc == SLAPD_ABANDON || rc == LDAP_CANCELLED ) { 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 e0800f4ffc..c83cb22b63 100644 --- a/servers/slapd/result.c +++ b/servers/slapd/result.c @@ -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 ) {