From 7a2f05016c6431f61d1ae27cf047c01cdee95367 Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Fri, 25 Nov 2005 20:44:56 +0000 Subject: [PATCH] Don't decrement op->ors_slimit, just compare with rs->sr_nentries. --- servers/slapd/result.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/servers/slapd/result.c b/servers/slapd/result.c index 5b085af138..72889c1e3f 100644 --- a/servers/slapd/result.c +++ b/servers/slapd/result.c @@ -689,7 +689,11 @@ slap_send_search_entry( Operation *op, SlapReply *rs ) * e_flags: array of a_flags */ char **e_flags = NULL; - + + if ( op->ors_slimit >= 0 && rs->sr_nentries >= op->ors_slimit ) { + return SLAPD_SEND_SIZELIMIT; + } + rs->sr_type = REP_SEARCH; /* eventually will loop through generated operational attribute types @@ -1125,15 +1129,6 @@ slap_send_search_entry( Operation *op, SlapReply *rs ) } if ( op->o_res_ber == NULL ) { - if ( --op->ors_slimit == -1 ) { - rc = SLAPD_SEND_SIZELIMIT; - ber_free_buf( ber ); - /* putback, so dumb backends that don't - * check sizelimit won't at least return - * more than expected... */ - op->ors_slimit++; - goto error_return; - } bytes = send_ldap_ber( op->o_conn, ber ); ber_free_buf( ber ); -- 2.39.5