int cancel_extop(
Connection *conn,
Operation *op,
- const char *reqoid,
+ struct berval *reqoid,
struct berval *reqdata,
char **rspoid,
struct berval **rspdata,
int i;
assert( reqoid != NULL );
- assert( strcmp( LDAP_EXOP_X_CANCEL, reqoid ) == 0 );
+ assert( ber_bvcmp( &slap_EXOP_CANCEL, reqoid ) == 0 );
if ( reqdata == NULL ) {
*text = "no message ID supplied";
}
ldap_pvt_thread_mutex_unlock( &conn->c_mutex );
- if ( found )
- return LDAP_SUCCESS;
+ if ( found ) return LDAP_SUCCESS;
found = 0;
ldap_pvt_thread_mutex_lock( &conn->c_mutex );
if ( !found ) {
#ifdef LDAP_SYNC
for ( i = 0; i < nbackends; i++ ) {
- if ( strncmp( backends[i].be_type, "bdb", 3 ) ) continue;
+ Backend *be = &backends[i];
+ if( !be->be_cancel ) continue;
+
ldap_pvt_thread_mutex_unlock( &conn->c_mutex );
- if ( bdb_cancel( &backends[i], conn, opid ) == LDAP_SUCCESS ) {
+
+ if ( be->be_cancel( be, conn, op, opid ) == LDAP_SUCCESS ) {
return LDAP_SUCCESS;
} else {
*text = "message ID not found";
}
}
#else
- *text = "message ID not found";
ldap_pvt_thread_mutex_unlock( &conn->c_mutex );
+ *text = "message ID not found";
return LDAP_NO_SUCH_OPERATION;
#endif
}
- if ( op->o_cancel != LDAP_CANCEL_NONE ) {
- *text = "message ID already being cancelled";
+ if ( op->o_cancel != SLAP_CANCEL_NONE ) {
ldap_pvt_thread_mutex_unlock( &conn->c_mutex );
+ *text = "message ID already being cancelled";
return LDAP_PROTOCOL_ERROR;
}
- op->o_cancel = LDAP_CANCEL_REQ;
+ op->o_cancel = SLAP_CANCEL_REQ;
ldap_pvt_thread_mutex_unlock( &conn->c_mutex );
- while ( op->o_cancel == LDAP_CANCEL_REQ ) {
+ while ( op->o_cancel == SLAP_CANCEL_REQ ) {
ldap_pvt_thread_yield();
}
- if ( op->o_cancel == LDAP_CANCEL_ACK ) {
+ if ( op->o_cancel == SLAP_CANCEL_ACK ) {
rc = LDAP_SUCCESS;
} else {
rc = op->o_cancel;
}
- op->o_cancel = LDAP_CANCEL_DONE;
+ op->o_cancel = SLAP_CANCEL_DONE;
return rc;
}