- if ( !found ) {
-#ifdef LDAP_SYNC
- for ( i = 0; i < nbackends; i++ ) {
- if ( strncmp( backends[i].be_type, "bdb", 3 ) ) continue;
- ldap_pvt_thread_mutex_unlock( &conn->c_mutex );
- if ( bdb_cancel( &backends[i], conn, opid ) == LDAP_SUCCESS ) {
+ ldap_pvt_thread_mutex_unlock( &op->o_conn->c_mutex );
+
+ if ( o ) {
+ if ( o->o_cancel != SLAP_CANCEL_NONE ) {
+ rs->sr_text = "message ID already being cancelled";
+ return LDAP_PROTOCOL_ERROR;
+ }
+
+ o->o_cancel = SLAP_CANCEL_REQ;
+
+ LDAP_STAILQ_FOREACH( op->o_bd, &backendDB, be_next ) {
+ if( !op->o_bd->be_cancel ) continue;
+
+ op->oq_cancel.rs_msgid = opid;
+ if ( op->o_bd->be_cancel( op, rs ) == LDAP_SUCCESS ) {