From: Kurt Zeilenga Date: Sun, 9 Feb 2003 05:54:45 +0000 (+0000) Subject: Cancel exop updates X-Git-Tag: NO_SLAP_OP_BLOCKS~398 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=282f6bc32d942d866edde41e8c35a96ae5b040c5;p=openldap Cancel exop updates --- diff --git a/include/ldap.h b/include/ldap.h index caff392517..f13a8a0388 100644 --- a/include/ldap.h +++ b/include/ldap.h @@ -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 diff --git a/servers/slapd/back-bdb/psearch.c b/servers/slapd/back-bdb/psearch.c index a53c0b0b72..2dbd40e752 100644 --- a/servers/slapd/back-bdb/psearch.c +++ b/servers/slapd/back-bdb/psearch.c @@ -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 diff --git a/servers/slapd/back-bdb/search.c b/servers/slapd/back-bdb/search.c index f72f0c6ea2..e54dc7142a 100644 --- a/servers/slapd/back-bdb/search.c +++ b/servers/slapd/back-bdb/search.c @@ -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 diff --git a/servers/slapd/cancel.c b/servers/slapd/cancel.c index fc2832bfab..dd98928941 100644 --- a/servers/slapd/cancel.c +++ b/servers/slapd/cancel.c @@ -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; } diff --git a/servers/slapd/connection.c b/servers/slapd/connection.c index f5fe518b77..2e79468558 100644 --- a/servers/slapd/connection.c +++ b/servers/slapd/connection.c @@ -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 diff --git a/servers/slapd/slap.h b/servers/slapd/slap.h index 13ee8ece45..0a63c1f969 100644 --- a/servers/slapd/slap.h +++ b/servers/slapd/slap.h @@ -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 */