ps = bdb_drop_psearch( op, op->oq_abandon.rs_msgid );
if ( ps ) {
if ( ps->o_tmpmemctx ) {
- sl_mem_destroy( NULL, ps->o_tmpmemctx );
+ slap_sl_mem_destroy( NULL, ps->o_tmpmemctx );
}
slap_op_free ( ps );
return LDAP_SUCCESS;
rs->sr_err = LDAP_CANCELLED;
send_ldap_result( ps, rs );
if ( ps->o_tmpmemctx ) {
- sl_mem_destroy( NULL, ps->o_tmpmemctx );
+ slap_sl_mem_destroy( NULL, ps->o_tmpmemctx );
}
slap_op_free ( ps );
return LDAP_SUCCESS;
ID candidates[BDB_IDL_UM_SIZE];
ID scopes[BDB_IDL_DB_SIZE];
Entry *e = NULL, base, e_root = {0};
- Entry *matched = NULL;
+ Entry *matched = NULL;
EntryInfo *ei, ei_root = {0};
struct berval realbase = BER_BVNULL;
int manageDSAit;
ID lastid = NOID;
AttributeName *attrs;
- Filter contextcsnand, contextcsnle, cookief, csnfnot,
- csnfeq, csnfand, csnfge;
+ Filter contextcsnand, contextcsnle, cookief, csnfnot,
+ csnfeq, csnfand, csnfge;
AttributeAssertion aa_ge, aa_eq, aa_le;
- int entry_count = 0;
- struct berval *search_context_csn = NULL;
+ struct berval *search_context_csn = NULL;
DB_LOCK ctxcsn_lock;
LDAPControl *ctrls[SLAP_MAX_RESPONSE_CONTROLS];
int num_ctrls = 0;
}
if ( get_pagedresults(sop) ) {
- if ( sop->o_pagedresults_state.ps_cookie == 0 ) {
- id = 0;
+ if ( (ID)( sop->o_pagedresults_state.ps_cookie ) == 0 ) {
+ id = bdb_idl_first( candidates, &cursor );
+
} else {
if ( sop->o_pagedresults_size == 0 ) {
rs->sr_err = LDAP_SUCCESS;
if ( rs->sr_err == LDAP_COMPARE_TRUE ) {
/* check size limit */
- if ( --sop->ors_slimit == -1 &&
- sop->o_sync_slog_size == -1 )
+ if ( --sop->ors_slimit == -1 &&
+ sop->o_sync_slog_size == -1 )
{
if (!IS_PSEARCH) {
bdb_cache_return_entry_r( bdb->bi_dbenv,
rs->sr_flags = 0;
result = send_search_entry( sop, rs );
if ( cookie.bv_val ) ch_free( cookie.bv_val );
- sl_free( ctrls[num_ctrls-1]->ldctl_value.bv_val,
+ slap_sl_free( ctrls[num_ctrls-1]->ldctl_value.bv_val,
sop->o_tmpmemctx );
- sl_free( ctrls[--num_ctrls], sop->o_tmpmemctx );
+ slap_sl_free( ctrls[--num_ctrls], sop->o_tmpmemctx );
ctrls[num_ctrls] = NULL;
rs->sr_ctrls = NULL;
}
rs->sr_attrs = sop->oq_search.rs_attrs;
rs->sr_flags = 0;
result = send_search_entry( sop, rs );
- sl_free( ctrls[num_ctrls-1]->ldctl_value.bv_val,
+ slap_sl_free( ctrls[num_ctrls-1]->ldctl_value.bv_val,
sop->o_tmpmemctx );
- sl_free( ctrls[--num_ctrls], sop->o_tmpmemctx );
+ slap_sl_free( ctrls[--num_ctrls], sop->o_tmpmemctx );
ctrls[num_ctrls] = NULL;
rs->sr_ctrls = NULL;
} else { /* PRESENT */
rs->sr_rspoid = NULL;
send_ldap_result( sop, rs );
if ( ctrls[num_ctrls-1]->ldctl_value.bv_val != NULL ) {
- sl_free( ctrls[num_ctrls-1]->ldctl_value.bv_val,
+ slap_sl_free( ctrls[num_ctrls-1]->ldctl_value.bv_val,
sop->o_tmpmemctx );
}
- sl_free( ctrls[--num_ctrls], sop->o_tmpmemctx );
+ slap_sl_free( ctrls[--num_ctrls], sop->o_tmpmemctx );
ctrls[num_ctrls] = NULL;
if ( cookie.bv_val ) ch_free( cookie.bv_val );
}
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;
cookie.bv_len = sizeof( respcookie );
cookie.bv_val = (char *)&respcookie;
done:
(void) ber_free_buf( ber );
-}
+}
+