]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/overlays/pcache.c
Happy New Year
[openldap] / servers / slapd / overlays / pcache.c
index b3e93bfc9ff632ea2b4b37f5b63f962e219d22be..c44a932af85c8a5ddb16ce27f24990cb703e038f 100644 (file)
@@ -1,7 +1,7 @@
 /* $OpenLDAP$ */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *
- * Copyright 2003-2015 The OpenLDAP Foundation.
+ * Copyright 2003-2018 The OpenLDAP Foundation.
  * Portions Copyright 2003 IBM Corporation.
  * Portions Copyright 2003-2009 Symas Corporation.
  * All rights reserved.
@@ -65,7 +65,7 @@ typedef struct Query_s {
 struct query_template_s;
 
 typedef struct Qbase_s {
-       Avlnode *scopes[4];             /* threaded AVL trees of cached queries */
+       TAvlnode *scopes[4];            /* threaded AVL trees of cached queries */
        struct berval base;
        int queries;
 } Qbase;
@@ -1272,14 +1272,14 @@ typedef struct fstack {
 } fstack;
 
 static CachedQuery *
-find_filter( Operation *op, Avlnode *root, Filter *inputf, Filter *first )
+find_filter( Operation *op, TAvlnode *root, Filter *inputf, Filter *first )
 {
        Filter* fs;
        Filter* fi;
        MatchingRule* mrule = NULL;
        int res=0, eqpass= 0;
        int ret, rc, dir;
-       Avlnode *ptr;
+       TAvlnode *ptr;
        CachedQuery cq, *qc;
        fstack *stack = NULL, *fsp;
 
@@ -2838,7 +2838,7 @@ pcache_op_bind(
        QueryTemplate *temp;
        Entry *e;
        slap_callback   cb = { 0 }, *sc;
-       bindinfo bi;
+       bindinfo bi = { 0 };
        bindcacheinfo *bci;
        Operation op2;
        int rc;
@@ -2868,7 +2868,6 @@ pcache_op_bind(
        op2 = *op;
        op2.o_dn = op->o_bd->be_rootdn;
        op2.o_ndn = op->o_bd->be_rootndn;
-       bi.bi_flags = 0;
 
        op2.o_bd = &cm->db;
        e = NULL;
@@ -2897,11 +2896,8 @@ pcache_op_bind(
         */
        bi.bi_cm = cm;
        bi.bi_templ = temp;
-       bi.bi_cq = NULL;
-       bi.bi_si = NULL;
 
        bi.bi_cb.sc_response = pc_bind_search;
-       bi.bi_cb.sc_cleanup = NULL;
        bi.bi_cb.sc_private = &bi;
        cb.sc_private = &bi;
        cb.sc_response = pc_bind_resp;
@@ -2937,6 +2933,7 @@ pcache_op_bind(
                sc->sc_response = pc_bind_save;
                sc->sc_cleanup = NULL;
                sc->sc_private = sc+1;
+               sc->sc_writewait = NULL;
                bci = sc->sc_private;
                sc->sc_next = op->o_callback;
                op->o_callback = sc;
@@ -3129,6 +3126,7 @@ pcache_op_search(
                cb->sc_response = pcache_response;
                cb->sc_cleanup = pcache_op_cleanup;
                cb->sc_private = (cb+1);
+               cb->sc_writewait = 0;
                si = cb->sc_private;
                si->on = on;
                si->query = query;