tentries = BDB_IDL_N(candidates);
}
- if ( get_pagedresults(sop) ) {
+ if ( get_pagedresults(sop) > SLAP_NO_CONTROL ) {
if ( (ID)( sop->o_pagedresults_state.ps_cookie ) == 0 ) {
id = bdb_idl_first( candidates, &cursor );
goto done;
}
- if ( get_pagedresults(sop) ) {
+ if ( get_pagedresults(sop) > SLAP_NO_CONTROL ) {
if ( rs->sr_nentries >= sop->o_pagedresults_size ) {
send_paged_response( sop, rs, &lastid, tentries );
goto done;
rs->sr_ref = rs->sr_v2ref;
rs->sr_err = (rs->sr_v2ref == NULL) ? LDAP_SUCCESS : LDAP_REFERRAL;
rs->sr_rspoid = NULL;
- if ( get_pagedresults(sop) ) {
+ if ( get_pagedresults(sop) > SLAP_NO_CONTROL ) {
send_paged_response( sop, rs, NULL, 0 );
} else {
send_ldap_result( sop, rs );
op->o_pagedresults_size = size;
- op->o_pagedresults = ctrl->ldctl_iscritical
- ? SLAP_CRITICAL_CONTROL
- : SLAP_NONCRITICAL_CONTROL;
+ /* NOTE: according to RFC 2696 3.:
+
+ If the page size is greater than or equal to the sizeLimit value, the
+ server should ignore the control as the request can be satisfied in a
+ single page.
+
+ * NOTE: this assumes that the op->ors_slimit be set
+ * before the controls are parsed.
+ */
+ if ( op->ors_slimit > 0 && size >= op->ors_slimit ) {
+ op->o_pagedresults = SLAP_IGNORED_CONTROL;
+
+ } else if ( ctrl->ldctl_iscritical ) {
+ op->o_pagedresults = SLAP_CRITICAL_CONTROL;
+
+ } else {
+ op->o_pagedresults = SLAP_NONCRITICAL_CONTROL;
+ }
return LDAP_SUCCESS;
}
}
/* if paged results is requested */
- if ( get_pagedresults( op ) ) {
+ if ( get_pagedresults( op ) > SLAP_NO_CONTROL ) {
int slimit = -2;
int pr_total;
char o_do_not_cache; /* don't cache groups from this op */
char o_is_auth_check; /* authorization in progress */
+#define SLAP_IGNORED_CONTROL -1
#define SLAP_NO_CONTROL 0
#define SLAP_NONCRITICAL_CONTROL 1
#define SLAP_CRITICAL_CONTROL 2