From 97f96aaaa698fede07e4c6befc988c2b338ed3ea Mon Sep 17 00:00:00 2001 From: Pierangelo Masarati Date: Sat, 19 Jun 2004 17:07:36 +0000 Subject: [PATCH] cleanup limits for internal searches... --- servers/slapd/limits.c | 13 ++++++++++--- servers/slapd/syncrepl.c | 3 +++ 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/servers/slapd/limits.c b/servers/slapd/limits.c index 467aec5197..3ea4877284 100644 --- a/servers/slapd/limits.c +++ b/servers/slapd/limits.c @@ -993,11 +993,18 @@ limits_check( Operation *op, SlapReply *rs ) { assert( op ); assert( rs ); - /* protocol only allows 0..maxInt */ - assert( op->ors_tlimit >= 0 ); - assert( op->ors_slimit >= 0 ); /* FIXME: should this be always true? */ assert( op->o_tag == LDAP_REQ_SEARCH); + + /* protocol only allows 0..maxInt; internal searches + * may use SLAP_NO_LIMIT ( = -1 ) to indicate no limits... */ + if ( op->ors_tlimit == SLAP_NO_LIMIT && op->ors_slimit == SLAP_NO_LIMIT ) { + return 0; + } + + /* fail when at least one is set to a negative value... */ + assert( op->ors_tlimit >= 0 ); + assert( op->ors_slimit >= 0 ); /* allow root to set no limit */ if ( be_isroot( op ) ) { diff --git a/servers/slapd/syncrepl.c b/servers/slapd/syncrepl.c index 42a3456b89..723bf05f77 100644 --- a/servers/slapd/syncrepl.c +++ b/servers/slapd/syncrepl.c @@ -1142,6 +1142,9 @@ syncrepl_entry( op->o_req_dn = si->si_base; op->o_req_ndn = si->si_base; + op->ors_tlimit = 0; + op->ors_slimit = 0; + /* set callback function */ op->o_callback = &cb; cb.sc_response = dn_callback; -- 2.39.5