]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/back-ldbm/search.c
rework op/rs structures to deal with opeartional attributes
[openldap] / servers / slapd / back-ldbm / search.c
index 4db79f7740ae3a97f74842abbca00a704d0cf2a1..e9b5f5c44a63163e3a7bf5aad3e891100b9433c5 100644 (file)
@@ -205,7 +205,7 @@ searchit:
        }
 
        /* if candidates exceed to-be-checked entries, abort */
-       if ( op->ors_limit      /* isroot == TRUE */
+       if ( op->ors_limit      /* isroot == FALSE */
                        && op->ors_limit->lms_s_unchecked != -1
                        && ID_BLOCK_NIDS( candidates ) > (unsigned) op->ors_limit->lms_s_unchecked )
        {
@@ -231,7 +231,9 @@ searchit:
                }
 
                /* check time limit */
-               if ( op->ors_tlimit != -1 && slap_get_time() > stoptime ) {
+               if ( op->ors_tlimit != SLAP_NO_LIMIT
+                               && slap_get_time() > stoptime )
+               {
                        rs->sr_err = LDAP_TIMELIMIT_EXCEEDED;
                        send_ldap_result( op, rs );
                        rc = LDAP_SUCCESS;
@@ -428,6 +430,7 @@ searchit:
                                if ( --op->ors_slimit == -1 ) {
                                        cache_return_entry_r( &li->li_cache, e );
                                        rs->sr_err = LDAP_SIZELIMIT_EXCEEDED;
+                                       rs->sr_entry = NULL;
                                        send_ldap_result( op, rs );
                                        rc = LDAP_SUCCESS;
                                        goto done;