int variantInScope = 0, rc = SLAP_CB_CONTINUE,
nmatch = sizeof(pmatch) / sizeof(regmatch_t);
- if ( ov->passReplication && ( op->o_sync > SLAP_CONTROL_IGNORED ) ) {
+ if ( ov->passReplication && wants_sync( op ) ) {
return SLAP_CB_CONTINUE;
}
op->o_callback = &cb;
}
- if ( get_pagedresults( op ) > SLAP_CONTROL_IGNORED ) {
+ if ( wants_pagedresults( op ) ) {
PagedResultsState *ps = op->o_pagedresults_state;
/* deferred cookie parsing */
rs->sr_err = parse_paged_cookie( op, rs );
if ( rs->sr_err == LDAP_COMPARE_TRUE ) {
/* check size limit */
- if ( get_pagedresults(op) > SLAP_CONTROL_IGNORED ) {
+ if ( wants_pagedresults(op) ) {
if ( rs->sr_nentries >= ((PagedResultsState *)op->o_pagedresults_state)->ps_size ) {
if (e != base)
mdb_entry_return( op, e );
rs->sr_ref = rs->sr_v2ref;
rs->sr_err = (rs->sr_v2ref == NULL) ? LDAP_SUCCESS : LDAP_REFERRAL;
rs->sr_rspoid = NULL;
- if ( get_pagedresults(op) > SLAP_CONTROL_IGNORED ) {
+ if ( wants_pagedresults(op) ) {
send_paged_response( op, rs, NULL, 0 );
} else {
send_ldap_result( op, rs );
/* this function must be invoked only if the pagedResults
* control has been detected, parsed and partially checked
* by the frontend */
- assert( get_pagedresults( op ) > SLAP_CONTROL_IGNORED );
+ assert( wants_pagedresults( op ) );
/* cookie decoding/checks deferred to backend... */
if ( ps->ps_cookieval.bv_len ) {
}
}
- if ( get_pagedresults( op ) > SLAP_CONTROL_IGNORED ) {
+ if ( wants_pagedresults( op ) ) {
struct berval cookie = BER_BVC( "" );
/* should not be here... */
#ifndef BACKSQL_ARBITRARY_KEY
/* If paged results are in effect, ignore low ldap_entries.id numbers */
- if ( get_pagedresults(bsi->bsi_op) > SLAP_CONTROL_IGNORED ) {
+ if ( wants_pagedresults(bsi->bsi_op) ) {
unsigned long lowid = 0;
/* Pick up the previous ldap_entries.id if the previous page ended in this objectClass */
#ifndef BACKSQL_ARBITRARY_KEY
/* If paged results have already completed this objectClass, skip it */
- if ( get_pagedresults(op) > SLAP_CONTROL_IGNORED ) {
+ if ( wants_pagedresults(op) ) {
if ( oc->bom_id < PAGECOOKIE_TO_SQL_OC( ((PagedResultsState *)op->o_pagedresults_state)->ps_cookie ) )
{
return BACKSQL_AVL_CONTINUE;
#ifndef BACKSQL_ARBITRARY_KEY
/* If paged results are in effect, check the paging cookie */
- if ( get_pagedresults( op ) > SLAP_CONTROL_IGNORED ) {
+ if ( wants_pagedresults( op ) ) {
rs->sr_err = parse_paged_cookie( op, rs );
if ( rs->sr_err != LDAP_SUCCESS ) {
send_ldap_result( op, rs );
{
#ifndef BACKSQL_ARBITRARY_KEY
/* If paged results are in effect, see if the page limit was exceeded */
- if ( get_pagedresults(op) > SLAP_CONTROL_IGNORED ) {
+ if ( wants_pagedresults(op) ) {
if ( rs->sr_nentries >= ((PagedResultsState *)op->o_pagedresults_state)->ps_size )
{
e = NULL;
send_results:;
if ( rs->sr_err != SLAPD_ABANDON ) {
#ifndef BACKSQL_ARBITRARY_KEY
- if ( get_pagedresults(op) > SLAP_CONTROL_IGNORED ) {
+ if ( wants_pagedresults(op) ) {
send_paged_response( op, rs, NULL );
} else
#endif /* ! BACKSQL_ARBITRARY_KEY */
/* this function must be invoked only if the pagedResults
* control has been detected, parsed and partially checked
* by the frontend */
- assert( get_pagedresults( op ) > SLAP_CONTROL_IGNORED );
+ assert( wants_pagedresults( op ) );
/* cookie decoding/checks deferred to backend... */
if ( ps->ps_cookieval.bv_len ) {
/* this function must be invoked only if the pagedResults
* control has been detected, parsed and partially checked
* by the frontend */
- assert( get_pagedresults( op ) > SLAP_CONTROL_IGNORED );
+ assert( wants_pagedresults( op ) );
/* cookie decoding/checks deferred to backend... */
if ( ps->ps_cookieval.bv_len ) {
tentries = WT_IDL_N(candidates);
}
- if ( get_pagedresults( op ) > SLAP_CONTROL_IGNORED ) {
+ if ( wants_pagedresults( op ) ) {
/* TODO: pageresult */
PagedResultsState *ps = op->o_pagedresults_state;
/* deferred cookie parsing */
rs->sr_err = test_filter( op, e, op->oq_search.rs_filter );
if ( rs->sr_err == LDAP_COMPARE_TRUE ) {
/* check size limit */
- if ( get_pagedresults(op) > SLAP_CONTROL_IGNORED ) {
+ if ( wants_pagedresults(op) ) {
if ( rs->sr_nentries >= ((PagedResultsState *)op->o_pagedresults_state)->ps_size ) {
wt_entry_return( e );
e = NULL;
rs->sr_ref = rs->sr_v2ref;
rs->sr_err = (rs->sr_v2ref == NULL) ? LDAP_SUCCESS : LDAP_REFERRAL;
rs->sr_rspoid = NULL;
- if ( get_pagedresults(op) > SLAP_CONTROL_IGNORED ) {
+ if ( wants_pagedresults(op) ) {
send_paged_response( op, rs, NULL, 0 );
} else {
send_ldap_result( op, rs );
/* Forget old pagedResults response if we're sending
* a new one now
*/
- if ( get_pagedresults( op ) > SLAP_CONTROL_IGNORED ) {
+ if ( wants_pagedresults( op ) ) {
int newpage = 0;
for ( k=0; k<i; k++ ) {
if ( !strcmp(rs->sr_ctrls[k]->ldctl_oid,
stoptime = slap_get_time () + op->ors_tlimit;
/* reset dummy cookie used to keep paged results going across databases */
- if ( get_pagedresults( op ) > SLAP_CONTROL_IGNORED
+ if ( wants_pagedresults( op )
&& bvmatch( &((PagedResultsState *)op->o_pagedresults_state)->ps_cookieval, &gluecookie ) )
{
PagedResultsState *ps = op->o_pagedresults_state;
/* If we remembered which backend we were on before,
* skip down to it now
*/
- if ( get_pagedresults( op ) > SLAP_CONTROL_IGNORED &&
+ if ( wants_pagedresults( op ) &&
op->o_conn->c_pagedresults_state.ps_be &&
op->o_conn->c_pagedresults_state.ps_be != btmp )
continue;
goto end_of_loop;
case LDAP_SUCCESS:
- if ( get_pagedresults( op ) > SLAP_CONTROL_IGNORED ) {
+ if ( wants_pagedresults( op ) ) {
PagedResultsState *ps = op->o_pagedresults_state;
/* Assume this backend can be forgotten now */
}
/* if paged results and slimit are requested */
- if ( get_pagedresults( op ) > SLAP_CONTROL_IGNORED &&
+ if ( wants_pagedresults( op ) &&
op->ors_slimit != SLAP_NO_LIMIT ) {
PagedResultsState *ps = op->o_pagedresults_state;
int total = op->ors_slimit - ps->ps_count;
}
/* if paged results is requested */
- if ( get_pagedresults( op ) > SLAP_CONTROL_IGNORED ) {
+ if ( wants_pagedresults( op ) ) {
int slimit = -2;
int pr_total;
PagedResultsState *ps = op->o_pagedresults_state;
dynlist_filterinst_t *df = NULL;
int ndf = 0;
- if ( get_pagedresults( op ) > SLAP_CONTROL_IGNORED )
+ if ( wants_pagedresults( op ) )
return SLAP_CB_CONTINUE;
/* Check for any unexpanded dynamic group entries that weren't picked up
goto leave;
}
- ps = ( op->o_pagedresults > SLAP_CONTROL_IGNORED ) ?
+ ps = wants_pagedresults( op ) ?
(PagedResultsState*)(op->o_pagedresults_state) : NULL;
vc = op->o_ctrlflag[vlv_cid] > SLAP_CONTROL_IGNORED ?
op->o_controls[vlv_cid] : NULL;
switch( mode ) {
case LDAP_SYNC_ADD:
- if ( ri->ri_isref && so->s_op->o_managedsait <= SLAP_CONTROL_IGNORED ) {
+ if ( ri->ri_isref && !wants_manageDSAit( so->s_op ) ) {
rs.sr_ref = get_entry_referrals( op, rs.sr_entry );
rs.sr_err = send_search_reference( op, &rs );
ber_bvarray_free( rs.sr_ref );
e_uuid.e_attrs = NULL;
e_uuid.e_name = ri->ri_dn;
e_uuid.e_nname = ri->ri_ndn;
- if ( ri->ri_isref && so->s_op->o_managedsait <= SLAP_CONTROL_IGNORED ) {
+ if ( ri->ri_isref && !wants_manageDSAit( so->s_op ) ) {
struct berval bv = BER_BVNULL;
rs.sr_ref = &bv;
rs.sr_err = send_search_reference( op, &rs );
int minsid, maxsid;
int dirty = 0;
- if ( op->o_sync > SLAP_CONTROL_IGNORED ) {
+ if ( wants_sync( op ) ) {
cb = op->o_tmpcalloc( 1, sizeof(slap_callback), op->o_tmpmemctx );
cb->sc_response = syncprov_search_cb;
cb->sc_cleanup = syncprov_search_cleanup;
struct berval fbv;
int rc = 0;
- if ( op->o_managedsait > SLAP_CONTROL_IGNORED )
+ if ( wants_manageDSAit( op ) )
return SLAP_CB_CONTINUE;
Debug(LDAP_DEBUG_TRACE, "==> translucent_search: <%s> %s\n",
op->o_req_dn.bv_val );
if ( be_shadow_update( op ) || (
- get_relax(op) > SLAP_CONTROL_IGNORED
- && access_allowed( op, op->ora_e,
+ wants_relax( op ) && access_allowed( op, op->ora_e,
slap_schema.si_ad_entry, NULL,
ACL_MANAGE, NULL ) ) ) {
return rc;
if ( be_shadow_update( op ) ) {
return rc;
}
- if ( get_relax(op) > SLAP_CONTROL_IGNORED
+ if ( wants_relax(op)
&& overlay_entry_get_ov( op, &op->o_req_ndn, NULL, NULL, 0, &e, on ) == LDAP_SUCCESS
&& e
&& access_allowed( op, e,
if ( be_shadow_update( op ) ) {
return rc;
}
- if ( get_relax(op) > SLAP_CONTROL_IGNORED
+ if ( wants_relax(op)
&& overlay_entry_get_ov( op, &op->o_req_ndn, NULL, NULL, 0, &e, on ) == LDAP_SUCCESS
&& e
&& access_allowed( op, e,
/* If this is not a search response, or it is a syncrepl response,
* or the valsort control wants raw results, pass thru unmodified.
*/
- if ( rs->sr_type != REP_SEARCH ||
- ( _SCM(op->o_sync) > SLAP_CONTROL_IGNORED ) ||
+ if ( rs->sr_type != REP_SEARCH || wants_sync( op ) ||
( op->o_ctrlflag[valsort_cid] & SLAP_CONTROL_DATA0))
return SLAP_CB_CONTINUE;