]> git.sur5r.net Git - openldap/commitdiff
ITS#7904 init wwctx earlier
authorHoward Chu <hyc@openldap.org>
Wed, 27 Aug 2014 10:50:32 +0000 (11:50 +0100)
committerQuanah Gibson-Mount <quanah@openldap.org>
Wed, 27 Aug 2014 16:45:15 +0000 (11:45 -0500)
servers/slapd/back-mdb/search.c

index f0eec7e524104a2449107fa0b66f4c887b7e050d..f5cc8815340dcce817ff705d059c3b5634286089 100644 (file)
@@ -682,6 +682,17 @@ dn2entry_retry:
                tentries = ncand;
        }
 
+       wwctx.flag = 0;
+       /* If we're running in our own read txn */
+       if (  moi == &opinfo ) {
+               cb.sc_writewait = mdb_writewait;
+               cb.sc_private = &wwctx;
+               wwctx.txn = ltid;
+               wwctx.mcd = NULL;
+               cb.sc_next = op->o_callback;
+               op->o_callback = &cb;
+       }
+
        if ( get_pagedresults( op ) > SLAP_CONTROL_IGNORED ) {
                PagedResultsState *ps = op->o_pagedresults_state;
                /* deferred cookie parsing */
@@ -740,17 +751,6 @@ dn2entry_retry:
                cscope = 1;     /* skip original base */
        } else {
                id = mdb_idl_first( candidates, &cursor );
-               wwctx.mcd = NULL;
-       }
-
-       wwctx.flag = 0;
-       /* If we're running in our own read txn */
-       if (  moi == &opinfo ) {
-               cb.sc_writewait = mdb_writewait;
-               cb.sc_private = &wwctx;
-               wwctx.txn = ltid;
-               cb.sc_next = op->o_callback;
-               op->o_callback = &cb;
        }
 
        while (id != NOID)