From: Pierangelo Masarati Date: Sat, 19 Jun 2004 17:07:36 +0000 (+0000) Subject: cleanup limits for internal searches... X-Git-Tag: OPENDLAP_REL_ENG_2_2_MP~224 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=97f96aaaa698fede07e4c6befc988c2b338ed3ea;p=openldap cleanup limits for internal searches... --- 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;