]> git.sur5r.net Git - openldap/commitdiff
Fix negative caching, only do it on Success
authorHoward Chu <hyc@openldap.org>
Fri, 27 Jan 2006 22:55:28 +0000 (22:55 +0000)
committerHoward Chu <hyc@openldap.org>
Fri, 27 Jan 2006 22:55:28 +0000 (22:55 +0000)
servers/slapd/overlays/pcache.c

index a1a5fdd7256e9c6e604ead1013fb0ddb3d891b9b..0fc10352e1e6ae31eb9f9f1bb31c352fe27c8bea 100644 (file)
@@ -1073,7 +1073,7 @@ pcache_response(
        } else if ( rs->sr_type == REP_RESULT ) {
                QueryTemplate* templ = (qm->templates)+si->template_id;
                if (( si->count && cache_entries( op, rs, &uuid ) == 0 ) ||
-                       ( !si->count && templ->negttl )) {
+                       ( !si->count && templ->negttl && rs->sr_err == LDAP_SUCCESS )) {
                        qm->addfunc(qm, &si->query, si->template_id,
                                si->count ? &uuid : NULL);