From: Pierangelo Masarati Date: Thu, 12 May 2005 22:37:56 +0000 (+0000) Subject: fix sizelimit bug (ITS#3720) X-Git-Tag: OPENLDAP_AC_BP~656 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=c4cfe036194597bafceb464504c0c8ad0af141ae;p=openldap fix sizelimit bug (ITS#3720) --- diff --git a/servers/slapd/back-meta/search.c b/servers/slapd/back-meta/search.c index ae30ba1d9f..d5113fb3f3 100644 --- a/servers/slapd/back-meta/search.c +++ b/servers/slapd/back-meta/search.c @@ -342,16 +342,6 @@ meta_back_search( Operation *op, SlapReply *rs ) break; } - if ( op->ors_slimit > 0 && rs->sr_nentries == op->ors_slimit ) - { - rs->sr_err = LDAP_SIZELIMIT_EXCEEDED; - savepriv = op->o_private; - op->o_private = (void *)i; - send_ldap_result( op, rs ); - op->o_private = savepriv; - goto finish; - } - /* * FIXME: handle time limit as well? * Note that target servers are likely @@ -388,6 +378,19 @@ really_bad:; goto finish; } else if ( rc == LDAP_RES_SEARCH_ENTRY ) { + if ( op->ors_slimit > 0 && rs->sr_nentries == op->ors_slimit ) + { + ldap_msgfree( res ); + res = NULL; + + rs->sr_err = LDAP_SIZELIMIT_EXCEEDED; + savepriv = op->o_private; + op->o_private = (void *)i; + send_ldap_result( op, rs ); + op->o_private = savepriv; + goto finish; + } + is_ok++; e = ldap_first_entry( msc->msc_ld, res );