]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/backglue.c
Fix negative caching again, be sure it's really from zero entries returned
[openldap] / servers / slapd / backglue.c
index e9c785f1a72919cfba6cb5c31bb1fcd75b94994b..e05412f46281d1f68d62bde080d68c241d9ae773 100644 (file)
@@ -2,7 +2,7 @@
 /* $OpenLDAP$ */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *
- * Copyright 2001-2005 The OpenLDAP Foundation.
+ * Copyright 2001-2006 The OpenLDAP Foundation.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -234,7 +234,7 @@ glue_op_search ( Operation *op, SlapReply *rs )
        BackendInfo *bi0 = op->o_bd->bd_info;
        int i;
        long stoptime = 0;
-       glue_state gs = {0, 0, 0, NULL, 0, NULL};
+       glue_state gs = {0, 0, NULL, 0, NULL};
        slap_callback cb = { NULL, glue_op_response, NULL, NULL };
        int scope0, tlimit0;
        struct berval dn, ndn, *pdn;
@@ -258,9 +258,7 @@ glue_op_search ( Operation *op, SlapReply *rs )
 
        case LDAP_SCOPE_ONELEVEL:
        case LDAP_SCOPE_SUBTREE:
-#ifdef LDAP_SCOPE_SUBORDINATE
        case LDAP_SCOPE_SUBORDINATE: /* FIXME */
-#endif
 
 #if 0
                if ( op->o_sync ) {
@@ -323,6 +321,9 @@ glue_op_search ( Operation *op, SlapReply *rs )
                                op->o_req_dn = op->o_bd->be_suffix[0];
                                op->o_req_ndn = op->o_bd->be_nsuffix[0];
                                rs->sr_err = op->o_bd->be_search(op, rs);
+                               if ( rs->sr_err == LDAP_NO_SUCH_OBJECT ) {
+                                       gs.err = LDAP_SUCCESS;
+                               }
 
                        } else if (scope0 == LDAP_SCOPE_SUBTREE &&
                                dn_match(&op->o_bd->be_nsuffix[0], &ndn))
@@ -338,6 +339,8 @@ glue_op_search ( Operation *op, SlapReply *rs )
                                if ( rs->sr_err == LDAP_NO_SUCH_OBJECT ) {
                                        gs.err = LDAP_SUCCESS;
                                }
+                               op->o_req_dn = dn;
+                               op->o_req_ndn = ndn;
 
                        } else if (dnIsSuffix(&ndn, &op->o_bd->be_nsuffix[0])) {
                                rs->sr_err = op->o_bd->be_search( op, rs );