From: Pierangelo Masarati Date: Sat, 17 Apr 2004 15:42:55 +0000 (+0000) Subject: yet another problem in pr limits X-Git-Tag: OPENDLAP_REL_ENG_2_2_MP~486 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=249a214ca647c254fd5848709fa7d75a7422ce46;p=openldap yet another problem in pr limits --- diff --git a/servers/slapd/limits.c b/servers/slapd/limits.c index 854c48c920..7507094432 100644 --- a/servers/slapd/limits.c +++ b/servers/slapd/limits.c @@ -985,7 +985,7 @@ limits_check( Operation *op, SlapReply *rs ) pr_total = op->ors_limit->lms_s_pr_total; } - if ( op->ors_limit->lms_s_pr_total == -1 ) { + if ( pr_total == -1 ) { slimit = -1; } else if ( pr_total > 0 && ( op->ors_slimit == -1 || op->ors_slimit > pr_total ) ) { @@ -1047,19 +1047,19 @@ limits_check( Operation *op, SlapReply *rs ) if ( op->ors_slimit <= 0 ) { op->ors_slimit = slimit; - } else if ( op->ors_slimit - op->o_pagedresults_state.ps_count > slimit ) { - rs->sr_err = LDAP_ADMINLIMIT_EXCEEDED; - send_ldap_result( op, rs ); - rs->sr_err = LDAP_SUCCESS; - return -1; - - } else { + } else if ( slimit > 0 ) { + if ( op->ors_slimit - op->o_pagedresults_state.ps_count > slimit ) { + rs->sr_err = LDAP_ADMINLIMIT_EXCEEDED; + send_ldap_result( op, rs ); + rs->sr_err = LDAP_SUCCESS; + return -1; + } op->ors_slimit = slimit; } } else { /* use the standard hard/soft limit if any */ - op->ors_slimit = op->ors_limit->lms_s_hard; + op->ors_slimit = pr_total; } /* no limit requested: use soft, whatever it is */