From c4cfe036194597bafceb464504c0c8ad0af141ae Mon Sep 17 00:00:00 2001 From: Pierangelo Masarati Date: Thu, 12 May 2005 22:37:56 +0000 Subject: [PATCH] fix sizelimit bug (ITS#3720) --- servers/slapd/back-meta/search.c | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) 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 ); -- 2.39.5