mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-12-25 17:19:43 -05:00
Cancel exop updates
This commit is contained in:
parent
c04e9ac993
commit
282f6bc32d
6 changed files with 19 additions and 20 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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 */
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue