/* for the LDAP Sync operation */
#define LDAP_SYNC_REFRESH_REQUIRED 0x4100
+/* for the LDAP No-Op control */
+#define LDAP_NO_OPERATION 0x410e
+
/* for the Assertion control */
#define LDAP_ASSERTION_FAILED 0x410f
{LDAP_REFERRAL_LIMIT_EXCEEDED, N_("Referral Limit Exceeded")},
{LDAP_SYNC_REFRESH_REQUIRED, N_("Content Sync Refresh Required")},
+
+ {LDAP_NO_OPERATION, N_("No Operation")},
{LDAP_ASSERTION_FAILED, N_("Assertion Failed")},
{LDAP_CANCELLED, N_("Cancelled")},
#endif
u_int32_t locker = 0;
DB_LOCK lock;
- int noop = 0;
int num_retries = 0;
if (( rs->sr_err=TXN_ABORT( ltid )) != 0 ) {
rs->sr_text = "txn_abort (no-op) failed";
} else {
- noop = 1;
- rs->sr_err = LDAP_SUCCESS;
+ rs->sr_err = LDAP_NO_OPERATION;
+ goto return_results;
}
} else {
}
}
- if ( rs->sr_err == LDAP_SUCCESS && !noop && !op->o_no_psearch ) {
+ if ( rs->sr_err == LDAP_SUCCESS && !op->o_no_psearch ) {
ldap_pvt_thread_rdwr_rlock( &bdb->bi_pslist_rwlock );
LDAP_LIST_FOREACH ( ps_list, &bdb->bi_psearch_list, o_ps_link ) {
- bdb_psearch( op, rs, ps_list, op->oq_add.rs_e, LDAP_PSEARCH_BY_ADD );
+ bdb_psearch( op, rs, ps_list, op->oq_add.rs_e,
+ LDAP_PSEARCH_BY_ADD );
}
ldap_pvt_thread_rdwr_runlock( &bdb->bi_pslist_rwlock );
}
ltid = NULL;
op->o_private = NULL;
- if (rs->sr_err != LDAP_SUCCESS) {
+ if ( rs->sr_err != LDAP_SUCCESS ) {
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, ERR,
"bdb_add: %s : %s (%d)\n", rs->sr_text,
op->o_private = NULL;
}
- return ( ( rs->sr_err == LDAP_SUCCESS ) ? noop : rs->sr_err );
+ return rs->sr_err;
}
u_int32_t locker = 0;
DB_LOCK lock, plock;
- int noop = 0;
-
int num_retries = 0;
Operation* ps_list;
if ( ( rs->sr_err = TXN_ABORT( ltid ) ) != 0 ) {
rs->sr_text = "txn_abort (no-op) failed";
} else {
- noop = 1;
- rs->sr_err = LDAP_SUCCESS;
+ rs->sr_err = LDAP_NO_OPERATION;
+ goto return_results;
}
} else {
bdb_cache_delete( &bdb->bi_cache, e, bdb->bi_dbenv,
}
}
- if ( rs->sr_err == LDAP_SUCCESS && !noop && !op->o_no_psearch ) {
+ if ( rs->sr_err == LDAP_SUCCESS && !op->o_no_psearch ) {
ldap_pvt_thread_rdwr_rlock( &bdb->bi_pslist_rwlock );
LDAP_LIST_FOREACH( ps_list, &bdb->bi_psearch_list, o_ps_link ) {
bdb_psearch( op, rs, ps_list, e, LDAP_PSEARCH_BY_DELETE );
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, ERR,
"bdb_delete: txn_%s failed: %s (%d)\n",
- op->o_noop ? "abort (no-op)" : "commit", db_strerror(rs->sr_err), rs->sr_err );
+ op->o_noop ? "abort (no-op)" : "commit",
+ db_strerror(rs->sr_err), rs->sr_err );
#else
Debug( LDAP_DEBUG_TRACE,
"bdb_delete: txn_%s failed: %s (%d)\n",
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, RESULTS,
"bdb_delete: deleted%s id=%08lx db=\"%s\"\n",
- op->o_noop ? " (no-op)" : "", e->e_id, e->e_dn );
+ op->o_noop ? " (no-op)" : "",
+ e->e_id, e->e_dn );
#else
Debug( LDAP_DEBUG_TRACE,
"bdb_delete: deleted%s id=%08lx dn=\"%s\"\n",
return_results:
send_ldap_result( op, rs );
- if(rs->sr_err == LDAP_SUCCESS && bdb->bi_txn_cp ) {
+ if( rs->sr_err == LDAP_SUCCESS && bdb->bi_txn_cp ) {
ldap_pvt_thread_yield();
TXN_CHECKPOINT( bdb->bi_dbenv,
bdb->bi_txn_cp_kbyte, bdb->bi_txn_cp_min, 0 );
op->o_private = NULL;
}
- return ( ( rs->sr_err == LDAP_SUCCESS ) ? noop : rs->sr_err );
+ return rs->sr_err;
}
u_int32_t locker = 0;
DB_LOCK lock;
- int noop = 0;
-
int num_retries = 0;
LDAPControl *ctrls[SLAP_MAX_RESPONSE_CONTROLS];
if ( ( rs->sr_err = TXN_ABORT( ltid ) ) != 0 ) {
rs->sr_text = "txn_abort (no-op) failed";
} else {
- noop = 1;
- rs->sr_err = LDAP_SUCCESS;
+ rs->sr_err = LDAP_NO_OPERATION;
+ goto return_results;
}
} else {
bdb_cache_modify( e, dummy.e_attrs, bdb->bi_dbenv, locker, &lock );
}
}
- if ( rs->sr_err == LDAP_SUCCESS && !op->o_noop ) {
+ if ( rs->sr_err == LDAP_SUCCESS ) {
/* Loop through in-scope entries for each psearch spec */
ldap_pvt_thread_rdwr_rlock( &bdb->bi_pslist_rwlock );
LDAP_LIST_FOREACH ( ps_list, &bdb->bi_psearch_list, o_ps_link ) {
if( e != NULL ) {
bdb_unlocked_cache_return_entry_w (&bdb->bi_cache, e);
}
- return ( ( rs->sr_err == LDAP_SUCCESS ) ? noop : rs->sr_err );
+ return rs->sr_err;
}
u_int32_t locker = 0;
DB_LOCK lock, plock, nplock;
- int noop = 0;
-
int num_retries = 0;
LDAPControl *ctrls[SLAP_MAX_RESPONSE_CONTROLS];
if(( rs->sr_err=TXN_ABORT( ltid )) != 0 ) {
rs->sr_text = "txn_abort (no-op) failed";
} else {
- noop = 1;
rs->sr_err = LDAP_SUCCESS;
+ goto return_results;
}
} else {
}
}
- if ( rs->sr_err == LDAP_SUCCESS && !op->o_noop ) {
+ if ( rs->sr_err == LDAP_SUCCESS ) {
/* Loop through in-scope entries for each psearch spec */
ldap_pvt_thread_rdwr_rlock( &bdb->bi_pslist_rwlock );
LDAP_LIST_FOREACH ( ps_list, &bdb->bi_psearch_list, o_ps_link ) {
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, RESULTS,
"bdb_modrdn: rdn modified%s id=%08lx dn=\"%s\"\n",
- op->o_noop ? " (no-op)" : "", e->e_id, e->e_dn );
+ op->o_noop ? " (no-op)" : "",
+ e->e_id, e->e_dn );
#else
Debug(LDAP_DEBUG_TRACE,
"bdb_modrdn: rdn modified%s id=%08lx dn=\"%s\"\n",
- op->o_noop ? " (no-op)" : "", e->e_id, e->e_dn );
+ op->o_noop ? " (no-op)" : "",
+ e->e_id, e->e_dn );
#endif
rs->sr_text = NULL;
if( num_ctrls ) rs->sr_ctrls = ctrls;
op->o_private = NULL;
}
- return ( ( rs->sr_err == LDAP_SUCCESS ) ? noop : rs->sr_err );
+ return rs->sr_err;
}
/* safe default */
int result = -1;
-#if 0 /* noop is masked SLAP_CTRL_UPDATE */
- if( op->o_noop ) {
- result = 0;
- } else
-#endif
if (IS_PSEARCH) {
int premodify_found = 0;
int entry_sync_state;
BackendInfo *bi )
{
static char *controls[] = {
+#if 0 /* needs updating */
#ifdef LDAP_CONTROL_NOOP
LDAP_CONTROL_NOOP,
#endif
+#endif
#ifdef LDAP_CONTROL_VALUESRETURNFILTER
LDAP_CONTROL_VALUESRETURNFILTER,
#endif
}
if ( op->o_res_ber == NULL ) {
- bytes = op->o_noop ? 0 : send_ldap_ber( op->o_conn, ber );
+ bytes = send_ldap_ber( op->o_conn, ber );
ber_free_buf( ber );
if ( bytes < 0 ) {
#ifdef LDAP_CONNECTIONLESS
if (!op->o_conn || op->o_conn->c_is_udp == 0) {
#endif
- bytes = op->o_noop ? 0 : send_ldap_ber( op->o_conn, ber );
+ bytes = send_ldap_ber( op->o_conn, ber );
ber_free_buf( ber );
ldap_pvt_thread_mutex_lock( &num_sent_mutex );