]> git.sur5r.net Git - openldap/commitdiff
Cancel exop updates
authorKurt Zeilenga <kurt@openldap.org>
Sun, 9 Feb 2003 05:54:45 +0000 (05:54 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Sun, 9 Feb 2003 05:54:45 +0000 (05:54 +0000)
include/ldap.h
servers/slapd/back-bdb/psearch.c
servers/slapd/back-bdb/search.c
servers/slapd/cancel.c
servers/slapd/connection.c
servers/slapd/slap.h

index caff392517bea18c2d0035d40fd680121d195fd6..f13a8a0388ef8fd3b8de3133c4140ebe66363602 100644 (file)
@@ -230,8 +230,8 @@ typedef struct ldapcontrol {
 #define LDAP_CONTROL_VLVRESPONSE    "2.16.840.1.113730.3.4.10"
 
 #ifdef LDAP_DEVEL
-#define LDAP_CONTROL_X_PERMISSIVE_MODIFY "1.2.840.113556.1.4.1413"
 #define LDAP_CONTROL_X_DOMAIN_SCOPE "1.2.840.113556.1.4.1339"
+#define LDAP_CONTROL_X_PERMISSIVE_MODIFY "1.2.840.113556.1.4.1413"
 #endif
 
 /* LDAP Unsolicited Notifications */
@@ -247,10 +247,10 @@ typedef struct ldapcontrol {
 #define LDAP_TAG_EXOP_MODIFY_PASSWD_NEW        ((ber_tag_t) 0x82U)
 #define LDAP_TAG_EXOP_MODIFY_PASSWD_GEN        ((ber_tag_t) 0x80U)
 
+#define LDAP_EXOP_X_WHO_AM_I   "1.3.6.1.4.1.4203.1.11.3"
 #ifdef LDAP_DEVEL
 #define LDAP_EXOP_X_CANCEL             "1.3.6.1.4.1.4203.666.6.3"
 #endif
-#define LDAP_EXOP_X_WHO_AM_I   "1.3.6.1.4.1.4203.1.11.3"
 
 /* LDAP Features */
 #define LDAP_FEATURE_ALL_OPERATIONAL_ATTRS "1.3.6.1.4.1.4203.1.5.1"  /* + */
@@ -502,11 +502,6 @@ typedef struct ldapcontrol {
 #define LDAP_NO_SUCH_OPERATION                 0x111
 #define LDAP_TOO_LATE                                  0x112
 #define LDAP_CANNOT_CANCEL                             0x113
-
-#define LDAP_CANCEL_NONE                               0x00
-#define LDAP_CANCEL_REQ                                        0x01
-#define LDAP_CANCEL_ACK                                        0x02
-#define LDAP_CANCEL_DONE                               0x03
 #endif
 
 #ifdef LDAP_CLIENT_UPDATE
index a53c0b0b7257d8636e218184fd81b7283b3b0fa7..2dbd40e7525e74e37f9f86d1ef900dbf3bb57282 100644 (file)
@@ -67,7 +67,7 @@ bdb_cancel(
        LDAP_LIST_FOREACH ( ps_list, &bdb->psearch_list, link ) {
                if ( ps_list->o_connid == conn->c_connid ) {
                        if ( ps_list->o_msgid == id ) {
-                               ps_list->o_cancel = LDAP_CANCEL_DONE;
+                               ps_list->o_cancel = SLAP_CANCEL_DONE;
                                LDAP_LIST_REMOVE( ps_list, link );
 
 #if 0
index f72f0c6ea2e94b8ac112ca65012aaccc9e438cbb..e54dc7142acde342f3a5b8f81327667d1234364c 100644 (file)
@@ -500,11 +500,11 @@ loop_begin:
 
 #ifdef LDAP_EXOP_X_CANCEL
                if ( op->o_cancel ) {
-                       assert( op->o_cancel == LDAP_CANCEL_REQ );
+                       assert( op->o_cancel == SLAP_CANCEL_REQ );
                        rc = 0;
                        send_search_result( conn, op, LDAP_CANCELLED,
                                        NULL, NULL, NULL, NULL, 0 );
-                       op->o_cancel = LDAP_CANCEL_ACK;
+                       op->o_cancel = SLAP_CANCEL_ACK;
                        goto done;
                }
 #endif
index fc2832bfabe7a8803829d3687856b1d4c9aa2583..dd98928941df40b94eba94548c5cb0f934438b7d 100644 (file)
@@ -107,26 +107,26 @@ int cancel_extop(
 #endif
        }
 
-       if ( op->o_cancel != LDAP_CANCEL_NONE ) {
+       if ( op->o_cancel != SLAP_CANCEL_NONE ) {
                *text = "message ID already being cancelled";
                ldap_pvt_thread_mutex_unlock( &conn->c_mutex );
                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;
 }
index f5fe518b7745e7cf9771778924e01ddefa969887..2e79468558d7021a78931f486d0ad12532ba4983 100644 (file)
@@ -1028,12 +1028,12 @@ operations_error:
        ldap_pvt_thread_mutex_unlock( &num_ops_mutex );
 
 #ifdef LDAP_EXOP_X_CANCEL
-       if ( arg->co_op->o_cancel == LDAP_CANCEL_REQ ) {
+       if ( arg->co_op->o_cancel == SLAP_CANCEL_REQ ) {
                arg->co_op->o_cancel = LDAP_TOO_LATE;
        }
 
-       while ( arg->co_op->o_cancel != LDAP_CANCEL_NONE &&
-               arg->co_op->o_cancel != LDAP_CANCEL_DONE )
+       while ( arg->co_op->o_cancel != SLAP_CANCEL_NONE &&
+               arg->co_op->o_cancel != SLAP_CANCEL_DONE )
        {
                ldap_pvt_thread_yield();
        }
@@ -1048,7 +1048,7 @@ operations_error:
        LDAP_STAILQ_NEXT(arg->co_op, o_next) = NULL;
 
 #if defined(LDAP_CLIENT_UPDATE) || defined(LDAP_SYNC)
-       if ( arg->co_op->o_cancel == LDAP_CANCEL_ACK )
+       if ( arg->co_op->o_cancel == SLAP_CANCEL_ACK )
                goto co_op_free;
 #endif
 #ifdef LDAP_CLIENT_UPDATE
index 13ee8ece4530f50e2c6fbd0a41f53a130d32c20c..0a63c1f969380d935c10cdcf5532289d3c9b8dfd 100644 (file)
@@ -1663,7 +1663,11 @@ typedef struct slap_op {
        ldap_pvt_thread_t       o_tid;  /* thread handling this op */
 
        volatile sig_atomic_t o_abandon;        /* abandon flag */
-       volatile sig_atomic_t o_cancel;         /* cancel flag */
+       volatile sig_atomic_t o_cancel;         /* cancel flag */
+#define SLAP_CANCEL_NONE                               0x00
+#define SLAP_CANCEL_REQ                                        0x01
+#define SLAP_CANCEL_ACK                                        0x02
+#define SLAP_CANCEL_DONE                               0x03
 
        char o_do_not_cache;    /* don't cache from this op */