]> git.sur5r.net Git - openldap/commitdiff
fix ITS#3196; more to do
authorPierangelo Masarati <ando@openldap.org>
Mon, 21 Jun 2004 17:51:28 +0000 (17:51 +0000)
committerPierangelo Masarati <ando@openldap.org>
Mon, 21 Jun 2004 17:51:28 +0000 (17:51 +0000)
servers/slapd/limits.c

index 0c62a25baa54df749bbaa6b20bbe7adabd268d26..ef483183fffff25bdd2976ada729fd5123243e7b 100644 (file)
@@ -1102,7 +1102,12 @@ limits_check( Operation *op, SlapReply *rs )
                        }
 
                        if ( pr_total == -1 ) {
-                               slimit = -1;
+                               if ( op->ors_slimit == 0 || op->ors_slimit == SLAP_MAX_LIMIT ) {
+                                       slimit = -1;
+
+                               } else {
+                                       slimit = op->ors_slimit - op->o_pagedresults_state.ps_count;
+                               }
 
                        } else if ( pr_total > 0 && op->ors_slimit != SLAP_MAX_LIMIT
                                        && ( op->ors_slimit == SLAP_NO_LIMIT || op->ors_slimit > pr_total ) )