]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/overlays/pcache.c
ITS#6002 fix attrset unparse
[openldap] / servers / slapd / overlays / pcache.c
index 141cc20a7a2358db89aeb2b2a0ff9eb773b747fa..2ad67c2f50ab6406a7ee261fb4bb3296ccfd711c 100644 (file)
@@ -1976,7 +1976,7 @@ pcache_op_cleanup( Operation *op, SlapReply *rs ) {
                Entry *e;
 
                /* don't return more entries than requested by the client */
-               if ( si->slimit && rs->sr_nentries >= si->slimit ) {
+               if ( si->slimit > 0 && rs->sr_nentries >= si->slimit ) {
                        si->slimit_exceeded = 1;
                }
 
@@ -1995,7 +1995,7 @@ pcache_op_cleanup( Operation *op, SlapReply *rs ) {
 
                        /* check for malformed entries: attrs with no values */
                        {
-                               Attribute *a = e->e_attrs;
+                               Attribute *a = rs->sr_entry->e_attrs;
                                for (; a; a=a->a_next) {
                                        if ( !a->a_numvals ) {
                                                Debug( pcache_debug, "%s: query not cacheable because of attrs without values in DN \"%s\" (%s)\n",
@@ -2460,7 +2460,7 @@ pcache_op_search(
                si->slimit = 0;
                si->slimit_exceeded = 0;
                si->caching_reason = PC_IGNORE;
-               if ( op->ors_slimit && op->ors_slimit < cm->num_entries_limit ) {
+               if ( op->ors_slimit > 0 && op->ors_slimit < cm->num_entries_limit ) {
                        si->slimit = op->ors_slimit;
                        op->ors_slimit = cm->num_entries_limit;
                }