]> git.sur5r.net Git - openldap/commitdiff
Don't decrement op->ors_slimit, just compare with rs->sr_nentries.
authorHoward Chu <hyc@openldap.org>
Fri, 25 Nov 2005 20:44:56 +0000 (20:44 +0000)
committerHoward Chu <hyc@openldap.org>
Fri, 25 Nov 2005 20:44:56 +0000 (20:44 +0000)
servers/slapd/result.c

index 5b085af13821e5338034bb4f16640e588f3d7789..72889c1e3f0c203060abbea2ab879e42a81c155a 100644 (file)
@@ -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 );