ID *ids,
ID *scopes );
-static void send_pagerequest_response(
+static void send_paged_response(
Operation *op,
SlapReply *rs,
ID lastid,
}
/* if not root and candidates exceed to-be-checked entries, abort */
- if ( sop->ors_limit /* isroot == TRUE */
- && sop->ors_limit->lms_s_unchecked != -1
- && BDB_IDL_N(candidates) > (unsigned) sop->ors_limit->lms_s_unchecked )
+ if ( sop->ors_limit /* isroot == TRUE */ &&
+ sop->ors_limit->lms_s_unchecked != -1 &&
+ BDB_IDL_N(candidates) > (unsigned) sop->ors_limit->lms_s_unchecked )
{
rs->sr_err = LDAP_ADMINLIMIT_EXCEEDED;
send_ldap_result( sop, rs );
goto done;
}
- if ( sop->ors_limit == NULL /* isroot == FALSE */
- || !sop->ors_limit->lms_s_pr_hide ) {
+ if ( sop->ors_limit == NULL /* isroot == FALSE */ ||
+ !sop->ors_limit->lms_s_pr_hide )
+ {
tentries = BDB_IDL_N(candidates);
}
goto done;
}
for ( id = bdb_idl_first( candidates, &cursor );
- id != NOID && id <= (ID)( sop->o_pagedresults_state.ps_cookie );
- id = bdb_idl_next( candidates, &cursor ) ) /* empty */;
+ id != NOID &&
+ id <= (ID)( sop->o_pagedresults_state.ps_cookie );
+ id = bdb_idl_next( candidates, &cursor ) )
+ {
+ /* empty */;
+ }
}
+
if ( cursor == NOID ) {
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, RESULTS,
"bdb_search: no paged results candidates\n",
- 0, 0, 0 );
+ 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE,
"bdb_search: no paged results candidates\n",
0, 0, 0 );
#endif
- send_pagerequest_response( sop, rs, lastid, 0 );
+ send_paged_response( sop, rs, lastid, 0 );
rs->sr_err = LDAP_OTHER;
goto done;
} else {
rs->sr_err = LDAP_COMPARE_TRUE;
}
+
} else {
if ( sop->o_sync_mode & SLAP_SYNC_REFRESH ) {
rc_sync = test_filter( sop, rs->sr_entry, &cookief );
#endif
}
entry_sync_state = LDAP_SYNC_ADD;
+
} else {
if ( no_sync_state_change ) {
goto loop_continue;
entry_sync_state = LDAP_SYNC_PRESENT;
}
}
+
} else {
rs->sr_err = test_filter( sop,
rs->sr_entry, sop->oq_search.rs_filter );
if ( rs->sr_err == LDAP_COMPARE_TRUE ) {
/* check size limit */
if ( --sop->ors_slimit == -1 &&
- sop->o_sync_slog_size == -1 )
+ sop->o_sync_slog_size == -1 )
{
if (!IS_PSEARCH) {
bdb_cache_return_entry_r( bdb->bi_dbenv,
if ( get_pagedresults(sop) ) {
if ( rs->sr_nentries >= sop->o_pagedresults_size ) {
- send_pagerequest_response( sop, rs,
- lastid, tentries );
+ send_paged_response( sop, rs, lastid, tentries );
goto done;
}
lastid = id;
}
if (psid_e != NULL) free (psid_e);
}
+
if ( ps_type == LDAP_PSEARCH_BY_ADD ) {
entry_sync_state = LDAP_SYNC_ADD;
} else if ( ps_type == LDAP_PSEARCH_BY_DELETE ) {
rs->sr_err = LDAP_OTHER;
goto done;
}
+
if ( sop->o_sync_slog_size != -1 ) {
if ( entry_sync_state == LDAP_SYNC_DELETE ) {
result = slap_add_session_log( op, sop, e );
rs->sr_flags = 0;
result = send_search_entry( sop, rs );
if ( cookie.bv_val ) ch_free( cookie.bv_val );
- slap_sl_free( ctrls[num_ctrls-1]->ldctl_value.bv_val,
- sop->o_tmpmemctx );
- slap_sl_free( ctrls[--num_ctrls], sop->o_tmpmemctx );
+ slap_sl_free(
+ ctrls[num_ctrls-1]->ldctl_value.bv_val,
+ sop->o_tmpmemctx );
+ slap_sl_free( ctrls[--num_ctrls],
+ sop->o_tmpmemctx );
ctrls[num_ctrls] = NULL;
rs->sr_ctrls = NULL;
}
+
} else if ( ps_type == LDAP_PSEARCH_BY_PREMODIFY ) {
struct psid_entry* psid_e;
psid_e = (struct psid_entry *) ch_calloc(1,
ps_type, 0, 0);
#endif
}
+
} else {
if ( sop->o_sync_mode & SLAP_SYNC_REFRESH ) {
if ( rc_sync == LDAP_COMPARE_TRUE ) { /* ADD */
rs->sr_attrs = sop->oq_search.rs_attrs;
rs->sr_flags = 0;
result = send_search_entry( sop, rs );
- slap_sl_free( ctrls[num_ctrls-1]->ldctl_value.bv_val,
- sop->o_tmpmemctx );
- slap_sl_free( ctrls[--num_ctrls], sop->o_tmpmemctx );
+ slap_sl_free(
+ ctrls[num_ctrls-1]->ldctl_value.bv_val,
+ sop->o_tmpmemctx );
+ slap_sl_free( ctrls[--num_ctrls],
+ sop->o_tmpmemctx );
ctrls[num_ctrls] = NULL;
rs->sr_ctrls = NULL;
+
} else { /* PRESENT */
if ( sync_send_present_mode ) {
result = slap_build_syncUUID_set( sop,
syncUUID_set_cnt = 0;
}
}
+
} else {
result = 1;
}
}
+
} else {
rs->sr_attrs = sop->oq_search.rs_attrs;
rs->sr_ctrls = NULL;
case 1: /* entry not sent */
break;
case -1: /* connection closed */
- if (!IS_PSEARCH)
- bdb_cache_return_entry_r(bdb->bi_dbenv,
- &bdb->bi_cache, e, &lock);
+ if (!IS_PSEARCH) {
+ bdb_cache_return_entry_r(bdb->bi_dbenv,
+ &bdb->bi_cache, e, &lock);
+ }
e = NULL;
rs->sr_entry = NULL;
rs->sr_err = LDAP_OTHER;
goto done;
}
}
+
} else {
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, RESULTS,
rs->sr_ctrls = NULL;
slap_send_syncinfo( sop, rs,
LDAP_TAG_SYNC_REFRESH_PRESENT, &cookie, 1, NULL, 0 );
+
} else {
if ( !no_sync_state_change ) {
int slog_found = 0;
{
if ( ps_list->o_sync_slog_size > 0 ) {
if ( ps_list->o_sync_state.sid ==
- sop->o_sync_state.sid ) {
+ sop->o_sync_state.sid )
+ {
slog_found = 1;
break;
}
}
ldap_pvt_thread_rdwr_runlock( &bdb->bi_pslist_rwlock );
}
+
rs->sr_err = LDAP_SUCCESS;
rs->sr_rspoid = LDAP_SYNC_INFO;
rs->sr_ctrls = NULL;
LDAP_TAG_SYNC_REFRESH_DELETE, &cookie, 1, NULL, 0 );
}
- if ( cookie.bv_val ) {
- ch_free( cookie.bv_val );
- }
+ if ( cookie.bv_val ) ch_free( cookie.bv_val );
+
} else {
/* refreshOnly mode */
struct berval cookie;
if ( sync_send_present_mode ) {
slap_build_sync_done_ctrl( sop, rs, ctrls,
num_ctrls++, 1, &cookie, LDAP_SYNC_REFRESH_PRESENTS );
+
} else {
if ( !no_sync_state_change ) {
int slog_found = 0;
}
ldap_pvt_thread_rdwr_runlock( &bdb->bi_pslist_rwlock );
}
+
slap_build_sync_done_ctrl( sop, rs, ctrls,
num_ctrls++, 1, &cookie, LDAP_SYNC_REFRESH_DELETES );
}
ctrls[num_ctrls] = NULL;
if ( cookie.bv_val ) ch_free( cookie.bv_val );
}
+
} else {
rs->sr_ctrls = NULL;
rs->sr_ref = rs->sr_v2ref;
}
static void
-send_pagerequest_response(
+send_paged_response(
Operation *op,
SlapReply *rs,
ID lastid,
#ifdef NEW_LOGGING
LDAP_LOG ( OPERATION, ENTRY,
- "send_pagerequest_response: lastid: (0x%08lx) "
+ "send_paged_response: lastid: (0x%08lx) "
"nentries: (0x%081x)\n",
lastid, rs->sr_nentries, NULL );
#else
- Debug(LDAP_DEBUG_ARGS, "send_pagerequest_response: lastid: (0x%08lx) "
+ Debug(LDAP_DEBUG_ARGS, "send_paged_response: lastid: (0x%08lx) "
"nentries: (0x%081x)\n", lastid, rs->sr_nentries, NULL );
#endif
respcookie = ( PagedResultsCookie )lastid;
op->o_conn->c_pagedresults_state.ps_cookie = respcookie;
- op->o_conn->c_pagedresults_state.ps_count = op->o_pagedresults_state.ps_count + rs->sr_nentries;
+ op->o_conn->c_pagedresults_state.ps_count =
+ op->o_pagedresults_state.ps_count + rs->sr_nentries;
cookie.bv_len = sizeof( respcookie );
cookie.bv_val = (char *)&respcookie;