]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/cancel.c
cleanup bind
[openldap] / servers / slapd / cancel.c
index dd98928941df40b94eba94548c5cb0f934438b7d..0fcce20d6991cff670ec92f99b61b7950ec06a98 100644 (file)
@@ -24,7 +24,7 @@
 int cancel_extop(
        Connection *conn,
        Operation *op,
-       const char *reqoid,
+       struct berval *reqoid,
        struct berval *reqdata,
        char **rspoid,
        struct berval **rspdata,
@@ -40,7 +40,7 @@ int cancel_extop(
        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";
@@ -76,8 +76,7 @@ int cancel_extop(
        }
        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 );
@@ -91,9 +90,12 @@ int cancel_extop(
        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";
@@ -101,15 +103,15 @@ int cancel_extop(
                        }
                }
 #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 != SLAP_CANCEL_NONE ) {
-               *text = "message ID already being cancelled";
                ldap_pvt_thread_mutex_unlock( &conn->c_mutex );
+               *text = "message ID already being cancelled";
                return LDAP_PROTOCOL_ERROR;
        }