From 249a214ca647c254fd5848709fa7d75a7422ce46 Mon Sep 17 00:00:00 2001 From: Pierangelo Masarati Date: Sat, 17 Apr 2004 15:42:55 +0000 Subject: [PATCH] yet another problem in pr limits --- servers/slapd/limits.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) 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 */ -- 2.39.5