r17186: "async" word abuse clean-up part 2
authorSimo Sorce <idra@samba.org>
Sat, 22 Jul 2006 17:21:59 +0000 (17:21 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 19:10:17 +0000 (14:10 -0500)
(This used to be commit c6aa60c7e69abf1f83efc150b1c3ed02751c45fc)

23 files changed:
source4/dsdb/samdb/ldb_modules/extended_dn.c
source4/dsdb/samdb/ldb_modules/kludge_acl.c
source4/dsdb/samdb/ldb_modules/objectguid.c
source4/dsdb/samdb/ldb_modules/partition.c
source4/dsdb/samdb/ldb_modules/password_hash.c
source4/dsdb/samdb/ldb_modules/rootdse.c
source4/dsdb/samdb/ldb_modules/samldb.c
source4/ldap_server/ldap_backend.c
source4/lib/ldb/common/ldb.c
source4/lib/ldb/include/ldb.h
source4/lib/ldb/ldb_ildap/ldb_ildap.c
source4/lib/ldb/ldb_ldap/ldb_ldap.c
source4/lib/ldb/ldb_sqlite3/ldb_sqlite3.c
source4/lib/ldb/ldb_tdb/ldb_search.c
source4/lib/ldb/ldb_tdb/ldb_tdb.c
source4/lib/ldb/modules/asq.c
source4/lib/ldb/modules/objectclass.c
source4/lib/ldb/modules/operational.c
source4/lib/ldb/modules/paged_results.c
source4/lib/ldb/modules/rdn_name.c
source4/lib/ldb/modules/sort.c
source4/lib/ldb/tools/ldbsearch.c
source4/torture/ldap/schema.c

index 0d8d49dea55e6ee7b3b486a2d4eb65daad20ce13..e79af5704270e6ec18126281219dea6c13b16fda 100644 (file)
@@ -167,7 +167,7 @@ static BOOL inject_extended_dn(struct ldb_message *msg,
 }
 
 /* search */
-struct extended_async_context {
+struct extended_context {
 
        struct ldb_module *module;
        void *up_context;
@@ -179,16 +179,16 @@ struct extended_async_context {
        int extended_type;
 };
 
-static int extended_async_callback(struct ldb_context *ldb, void *context, struct ldb_reply *ares)
+static int extended_callback(struct ldb_context *ldb, void *context, struct ldb_reply *ares)
 {
-       struct extended_async_context *ac;
+       struct extended_context *ac;
 
        if (!context || !ares) {
                ldb_set_errstring(ldb, talloc_asprintf(ldb, "NULL Context or Result in callback"));
                goto error;
        }
 
-       ac = talloc_get_type(context, struct extended_async_context);
+       ac = talloc_get_type(context, struct extended_context);
 
        if (ares->type == LDB_REPLY_ENTRY) {
                /* for each record returned post-process to add any derived
@@ -205,12 +205,12 @@ error:
        return LDB_ERR_OPERATIONS_ERROR;
 }
 
-static int extended_search_async(struct ldb_module *module, struct ldb_request *req)
+static int extended_search(struct ldb_module *module, struct ldb_request *req)
 {
        struct ldb_control *control;
        struct ldb_extended_dn_control *extended_ctrl;
        struct ldb_control **saved_controls;
-       struct extended_async_context *ac;
+       struct extended_context *ac;
        struct ldb_request *down_req;
        char **new_attrs;
        int ret;
@@ -227,14 +227,14 @@ static int extended_search_async(struct ldb_module *module, struct ldb_request *
                return LDB_ERR_PROTOCOL_ERROR;
        }
 
-       ac = talloc(req, struct extended_async_context);
+       ac = talloc(req, struct extended_context);
        if (ac == NULL) {
                return LDB_ERR_OPERATIONS_ERROR;
        }
 
        ac->module = module;
-       ac->up_context = req->async.context;
-       ac->up_callback = req->async.callback;
+       ac->up_context = req->context;
+       ac->up_callback = req->callback;
        ac->attrs = req->op.search.attrs;
        ac->remove_guid = False;
        ac->remove_sid = False;
@@ -285,8 +285,8 @@ static int extended_search_async(struct ldb_module *module, struct ldb_request *
                return LDB_ERR_OPERATIONS_ERROR;
        }
 
-       down_req->async.context = ac;
-       down_req->async.callback = extended_async_callback;
+       down_req->context = ac;
+       down_req->callback = extended_callback;
        ldb_set_timeout_from_prev_req(module->ldb, req, down_req);
 
        /* perform the search */
@@ -295,7 +295,7 @@ static int extended_search_async(struct ldb_module *module, struct ldb_request *
        /* do not free down_req as the call results may be linked to it,
         * it will be freed when the upper level request get freed */
        if (ret == LDB_SUCCESS) {
-               req->async.handle = down_req->async.handle;
+               req->handle = down_req->handle;
        }
 
        return ret;
@@ -328,7 +328,7 @@ static int extended_init(struct ldb_module *module)
 
 static const struct ldb_module_ops extended_dn_ops = {
        .name              = "extended_dn",
-       .search            = extended_search_async,
+       .search            = extended_search,
        .init_context      = extended_init
 };
 
index 09173f0aa4a875a774689ed56be2e8beb77e359a..ecb3e00f9568d7dc4f7c055ada19fd2d6ba1264b 100644 (file)
@@ -98,7 +98,7 @@ static const char *user_name(TALLOC_CTX *mem_ctx, struct ldb_module *module)
 }
 
 /* search */
-struct kludge_acl_async_context {
+struct kludge_acl_context {
 
        struct ldb_module *module;
        void *up_context;
@@ -107,9 +107,9 @@ struct kludge_acl_async_context {
        enum user_is user_type;
 };
 
-static int kludge_acl_async_callback(struct ldb_context *ldb, void *context, struct ldb_reply *ares)
+static int kludge_acl_callback(struct ldb_context *ldb, void *context, struct ldb_reply *ares)
 {
-       struct kludge_acl_async_context *ac;
+       struct kludge_acl_context *ac;
        struct kludge_private_data *data;
        int i;
 
@@ -118,7 +118,7 @@ static int kludge_acl_async_callback(struct ldb_context *ldb, void *context, str
                goto error;
        }
 
-       ac = talloc_get_type(context, struct kludge_acl_async_context);
+       ac = talloc_get_type(context, struct kludge_acl_context);
        data = talloc_get_type(ac->module->private_data, struct kludge_private_data);
 
        if (ares->type == LDB_REPLY_ENTRY
@@ -143,22 +143,22 @@ error:
        return LDB_ERR_OPERATIONS_ERROR;
 }
 
-static int kludge_acl_search_async(struct ldb_module *module, struct ldb_request *req)
+static int kludge_acl_search(struct ldb_module *module, struct ldb_request *req)
 {
-       struct kludge_acl_async_context *ac;
+       struct kludge_acl_context *ac;
        struct ldb_request *down_req;
        int ret;
 
-       req->async.handle = NULL;
+       req->handle = NULL;
 
-       ac = talloc(req, struct kludge_acl_async_context);
+       ac = talloc(req, struct kludge_acl_context);
        if (ac == NULL) {
                return LDB_ERR_OPERATIONS_ERROR;
        }
 
        ac->module = module;
-       ac->up_context = req->async.context;
-       ac->up_callback = req->async.callback;
+       ac->up_context = req->context;
+       ac->up_callback = req->callback;
        ac->user_type = what_is_user(module);
 
        down_req = talloc_zero(req, struct ldb_request);
@@ -174,8 +174,8 @@ static int kludge_acl_search_async(struct ldb_module *module, struct ldb_request
        
        down_req->controls = req->controls;
 
-       down_req->async.context = ac;
-       down_req->async.callback = kludge_acl_async_callback;
+       down_req->context = ac;
+       down_req->callback = kludge_acl_callback;
        ldb_set_timeout_from_prev_req(module->ldb, req, down_req);
 
        /* perform the search */
@@ -184,7 +184,7 @@ static int kludge_acl_search_async(struct ldb_module *module, struct ldb_request
        /* do not free down_req as the call results may be linked to it,
         * it will be freed when the upper level request get freed */
        if (ret == LDB_SUCCESS) {
-               req->async.handle = down_req->async.handle;
+               req->handle = down_req->handle;
        }
 
        return ret;
@@ -271,7 +271,7 @@ done:
 
 static const struct ldb_module_ops kludge_acl_ops = {
        .name              = "kludge_acl",
-       .search            = kludge_acl_search_async,
+       .search            = kludge_acl_search,
        .add               = kludge_acl_change,
        .modify            = kludge_acl_change,
        .del               = kludge_acl_change,
index 3f6a95199779454eeccb711e0f1ee00228216bf0..1f18f0e6034f89dc327e758f034030d5c42e166a 100644 (file)
@@ -107,7 +107,7 @@ static int objectguid_add(struct ldb_module *module, struct ldb_request *req)
        /* do not free down_req as the call results may be linked to it,
         * it will be freed when the upper level request get freed */
        if (ret == LDB_SUCCESS) {
-               req->async.handle = down_req->async.handle;
+               req->handle = down_req->handle;
        }
 
        return ret;
index 0dcf710ba4604ba06dc7100c87304d87701f9d6b..92fddca27004f3762d5b91f8348ca06c2227c995 100644 (file)
@@ -167,7 +167,7 @@ static int partition_search(struct ldb_module *module, struct ldb_request *req)
                        return LDB_ERR_OPERATIONS_ERROR;
                }
                /* return our own handle to deal with this call */
-               req->async.handle = h;
+               req->handle = h;
                
                ac = talloc_get_type(h->private_data, struct partition_context);
                
@@ -537,18 +537,18 @@ static int partition_wait_none(struct ldb_handle *handle) {
        ac = talloc_get_type(handle->private_data, struct partition_context);
 
        for (i=0; i < ac->num_searches; i++) {
-               ret = ldb_wait(ac->search_req[i]->async.handle, LDB_WAIT_NONE);
+               ret = ldb_wait(ac->search_req[i]->handle, LDB_WAIT_NONE);
                
                if (ret != LDB_SUCCESS) {
                        handle->status = ret;
                        goto done;
                }
-               if (ac->search_req[i]->async.handle->status != LDB_SUCCESS) {
-                       handle->status = ac->search_req[i]->async.handle->status;
+               if (ac->search_req[i]->handle->status != LDB_SUCCESS) {
+                       handle->status = ac->search_req[i]->handle->status;
                        goto done;
                }
                
-               if (ac->search_req[i]->async.handle->state != LDB_ASYNC_DONE) {
+               if (ac->search_req[i]->handle->state != LDB_ASYNC_DONE) {
                        return LDB_SUCCESS;
                }
        }
index d6c2a452176a81048f3cb6dc0e63c4c0dc028d02..ec422496333b3eeacd67ecb373b15a36c0075aae 100644 (file)
@@ -509,9 +509,9 @@ static int build_domain_data_request(struct ph_context *ac)
        }
        ac->dom_req->op.search.attrs = attrs;
        ac->dom_req->controls = NULL;
-       ac->dom_req->async.context = ac;
-       ac->dom_req->async.callback = get_domain_data_callback;
-       ac->dom_req->async.timeout = ac->orig_req->async.timeout;
+       ac->dom_req->context = ac;
+       ac->dom_req->callback = get_domain_data_callback;
+       ac->dom_req->timeout = ac->orig_req->timeout;
        ldb_set_timeout_from_prev_req(ac->module->ldb, ac->orig_req, ac->dom_req);
 
        return LDB_SUCCESS;
@@ -637,7 +637,7 @@ static int password_hash_add(struct ldb_module *module, struct ldb_request *req)
 
        ac->step = PH_ADD_SEARCH_DOM;
 
-       req->async.handle = h;
+       req->handle = h;
 
        return ldb_next_request(module, ac->dom_req);
 }
@@ -787,7 +787,7 @@ static int password_hash_modify(struct ldb_module *module, struct ldb_request *r
        ac = talloc_get_type(h->private_data, struct ph_context);
 
        /* return or own handle to deal with this call */
-       req->async.handle = h;
+       req->handle = h;
 
        /* prepare the first operation */
        ac->down_req = talloc_zero(ac, struct ldb_request);
@@ -814,8 +814,8 @@ static int password_hash_modify(struct ldb_module *module, struct ldb_request *r
                return password_hash_mod_search_self(h);
        }
        
-       ac->down_req->async.context = NULL;
-       ac->down_req->async.callback = NULL;
+       ac->down_req->context = NULL;
+       ac->down_req->callback = NULL;
 
        ac->step = PH_MOD_DO_REQ;
 
@@ -889,8 +889,8 @@ static int password_hash_mod_search_self(struct ldb_handle *h) {
        }
        ac->search_req->op.search.attrs = attrs;
        ac->search_req->controls = NULL;
-       ac->search_req->async.context = ac;
-       ac->search_req->async.callback = get_self_callback;
+       ac->search_req->context = ac;
+       ac->search_req->callback = get_self_callback;
        ldb_set_timeout_from_prev_req(ac->module->ldb, ac->orig_req, ac->search_req);
 
        ac->step = PH_MOD_SEARCH_SELF;
@@ -1079,18 +1079,18 @@ static int ph_wait(struct ldb_handle *handle) {
 
        switch (ac->step) {
        case PH_ADD_SEARCH_DOM:
-               ret = ldb_wait(ac->dom_req->async.handle, LDB_WAIT_NONE);
+               ret = ldb_wait(ac->dom_req->handle, LDB_WAIT_NONE);
 
                if (ret != LDB_SUCCESS) {
                        handle->status = ret;
                        goto done;
                }
-               if (ac->dom_req->async.handle->status != LDB_SUCCESS) {
-                       handle->status = ac->dom_req->async.handle->status;
+               if (ac->dom_req->handle->status != LDB_SUCCESS) {
+                       handle->status = ac->dom_req->handle->status;
                        goto done;
                }
 
-               if (ac->dom_req->async.handle->state != LDB_ASYNC_DONE) {
+               if (ac->dom_req->handle->state != LDB_ASYNC_DONE) {
                        return LDB_SUCCESS;
                }
 
@@ -1098,36 +1098,36 @@ static int ph_wait(struct ldb_handle *handle) {
                return password_hash_add_do_add(handle);
 
        case PH_ADD_DO_ADD:
-               ret = ldb_wait(ac->down_req->async.handle, LDB_WAIT_NONE);
+               ret = ldb_wait(ac->down_req->handle, LDB_WAIT_NONE);
 
                if (ret != LDB_SUCCESS) {
                        handle->status = ret;
                        goto done;
                }
-               if (ac->down_req->async.handle->status != LDB_SUCCESS) {
-                       handle->status = ac->down_req->async.handle->status;
+               if (ac->down_req->handle->status != LDB_SUCCESS) {
+                       handle->status = ac->down_req->handle->status;
                        goto done;
                }
 
-               if (ac->down_req->async.handle->state != LDB_ASYNC_DONE) {
+               if (ac->down_req->handle->state != LDB_ASYNC_DONE) {
                        return LDB_SUCCESS;
                }
 
                break;
                
        case PH_MOD_DO_REQ:
-               ret = ldb_wait(ac->down_req->async.handle, LDB_WAIT_NONE);
+               ret = ldb_wait(ac->down_req->handle, LDB_WAIT_NONE);
 
                if (ret != LDB_SUCCESS) {
                        handle->status = ret;
                        goto done;
                }
-               if (ac->down_req->async.handle->status != LDB_SUCCESS) {
-                       handle->status = ac->down_req->async.handle->status;
+               if (ac->down_req->handle->status != LDB_SUCCESS) {
+                       handle->status = ac->down_req->handle->status;
                        goto done;
                }
 
-               if (ac->down_req->async.handle->state != LDB_ASYNC_DONE) {
+               if (ac->down_req->handle->state != LDB_ASYNC_DONE) {
                        return LDB_SUCCESS;
                }
 
@@ -1135,18 +1135,18 @@ static int ph_wait(struct ldb_handle *handle) {
                return password_hash_mod_search_self(handle);
                
        case PH_MOD_SEARCH_SELF:
-               ret = ldb_wait(ac->search_req->async.handle, LDB_WAIT_NONE);
+               ret = ldb_wait(ac->search_req->handle, LDB_WAIT_NONE);
 
                if (ret != LDB_SUCCESS) {
                        handle->status = ret;
                        goto done;
                }
-               if (ac->search_req->async.handle->status != LDB_SUCCESS) {
-                       handle->status = ac->search_req->async.handle->status;
+               if (ac->search_req->handle->status != LDB_SUCCESS) {
+                       handle->status = ac->search_req->handle->status;
                        goto done;
                }
 
-               if (ac->search_req->async.handle->state != LDB_ASYNC_DONE) {
+               if (ac->search_req->handle->state != LDB_ASYNC_DONE) {
                        return LDB_SUCCESS;
                }
 
@@ -1154,18 +1154,18 @@ static int ph_wait(struct ldb_handle *handle) {
                return password_hash_mod_search_dom(handle);
                
        case PH_MOD_SEARCH_DOM:
-               ret = ldb_wait(ac->dom_req->async.handle, LDB_WAIT_NONE);
+               ret = ldb_wait(ac->dom_req->handle, LDB_WAIT_NONE);
 
                if (ret != LDB_SUCCESS) {
                        handle->status = ret;
                        goto done;
                }
-               if (ac->dom_req->async.handle->status != LDB_SUCCESS) {
-                       handle->status = ac->dom_req->async.handle->status;
+               if (ac->dom_req->handle->status != LDB_SUCCESS) {
+                       handle->status = ac->dom_req->handle->status;
                        goto done;
                }
 
-               if (ac->dom_req->async.handle->state != LDB_ASYNC_DONE) {
+               if (ac->dom_req->handle->state != LDB_ASYNC_DONE) {
                        return LDB_SUCCESS;
                }
 
@@ -1173,18 +1173,18 @@ static int ph_wait(struct ldb_handle *handle) {
                return password_hash_mod_do_mod(handle);
 
        case PH_MOD_DO_MOD:
-               ret = ldb_wait(ac->mod_req->async.handle, LDB_WAIT_NONE);
+               ret = ldb_wait(ac->mod_req->handle, LDB_WAIT_NONE);
 
                if (ret != LDB_SUCCESS) {
                        handle->status = ret;
                        goto done;
                }
-               if (ac->mod_req->async.handle->status != LDB_SUCCESS) {
-                       handle->status = ac->mod_req->async.handle->status;
+               if (ac->mod_req->handle->status != LDB_SUCCESS) {
+                       handle->status = ac->mod_req->handle->status;
                        goto done;
                }
 
-               if (ac->mod_req->async.handle->state != LDB_ASYNC_DONE) {
+               if (ac->mod_req->handle->state != LDB_ASYNC_DONE) {
                        return LDB_SUCCESS;
                }
 
index 01421d2817fa3c6d3b32b223c0564f96c4c4fc5a..efb3d9a05f9138d8ecc5d8f595a2f937b3e33502 100644 (file)
@@ -139,7 +139,7 @@ failed:
   handle search requests
 */
 
-struct rootdse_async_context {
+struct rootdse_context {
        struct ldb_module *module;
        void *up_context;
        int (*up_callback)(struct ldb_context *, void *, struct ldb_reply *);
@@ -147,16 +147,16 @@ struct rootdse_async_context {
        const char * const * attrs;
 };
 
-static int rootdse_async_callback(struct ldb_context *ldb, void *context, struct ldb_reply *ares)
+static int rootdse_callback(struct ldb_context *ldb, void *context, struct ldb_reply *ares)
 {
-       struct rootdse_async_context *ac;
+       struct rootdse_context *ac;
 
        if (!context || !ares) {
                ldb_set_errstring(ldb, talloc_asprintf(ldb, "NULL Context or Result in callback"));
                goto error;
        }
 
-       ac = talloc_get_type(context, struct rootdse_async_context);
+       ac = talloc_get_type(context, struct rootdse_context);
 
        if (ares->type == LDB_REPLY_ENTRY) {
                /* for each record returned post-process to add any dynamic
@@ -175,7 +175,7 @@ error:
 
 static int rootdse_search(struct ldb_module *module, struct ldb_request *req)
 {
-       struct rootdse_async_context *ac;
+       struct rootdse_context *ac;
        struct ldb_request *down_req;
        int ret;
 
@@ -185,14 +185,14 @@ static int rootdse_search(struct ldb_module *module, struct ldb_request *req)
                return ldb_next_request(module, req);
        }
 
-       ac = talloc(req, struct rootdse_async_context);
+       ac = talloc(req, struct rootdse_context);
        if (ac == NULL) {
                return LDB_ERR_OPERATIONS_ERROR;
        }
 
        ac->module = module;
-       ac->up_context = req->async.context;
-       ac->up_callback = req->async.callback;
+       ac->up_context = req->context;
+       ac->up_callback = req->callback;
        ac->attrs = req->op.search.attrs;
 
        down_req = talloc_zero(req, struct ldb_request);
@@ -213,8 +213,8 @@ static int rootdse_search(struct ldb_module *module, struct ldb_request *req)
        down_req->op.search.attrs = req->op.search.attrs;
        down_req->controls = req->controls;
 
-       down_req->async.context = ac;
-       down_req->async.callback = rootdse_async_callback;
+       down_req->context = ac;
+       down_req->callback = rootdse_callback;
        ldb_set_timeout_from_prev_req(module->ldb, req, down_req);
 
        /* perform the search */
@@ -223,7 +223,7 @@ static int rootdse_search(struct ldb_module *module, struct ldb_request *req)
        /* do not free down_req as the call results may be linked to it,
         * it will be freed when the upper level request get freed */
        if (ret == LDB_SUCCESS) {
-               req->async.handle = down_req->async.handle;
+               req->handle = down_req->handle;
        }
 
        return ret;
index 81bfa32398ad52af10710d07f66ea7e67f19d4c8..d0c278257e4cbd92a8849440dabef35985c3b4ab 100644 (file)
@@ -740,7 +740,7 @@ static int samldb_add(struct ldb_module *module, struct ldb_request *req)
        /* do not free down_req as the call results may be linked to it,
         * it will be freed when the upper level request get freed */
        if (ret == LDB_SUCCESS) {
-               req->async.handle = down_req->async.handle;
+               req->handle = down_req->handle;
        }
 
        return ret;
index 3f9aaf6af85da5f0c5394f685feece20b180c86f..6e4df86b88feccb860d5ba6285dc53f1e7b26d86 100644 (file)
@@ -250,8 +250,8 @@ static NTSTATUS ldapsrv_SearchRequest(struct ldapsrv_call *call)
 
        lreq->controls = call->request->controls;
 
-       lreq->async.context = res;
-       lreq->async.callback = ldapsrv_SearchCallback;
+       lreq->context = res;
+       lreq->callback = ldapsrv_SearchCallback;
 
        /* Copy the timeout from the incoming call */
        ldb_set_timeout(samdb, lreq, req->timelimit);
@@ -262,7 +262,7 @@ static NTSTATUS ldapsrv_SearchRequest(struct ldapsrv_call *call)
                goto reply;
        }
 
-       ldb_ret = ldb_wait(lreq->async.handle, LDB_WAIT_ALL);
+       ldb_ret = ldb_wait(lreq->handle, LDB_WAIT_ALL);
 
        if (ldb_ret == LDB_SUCCESS) {
                for (i = 0; i < res->count; i++) {
index a962aa432220504e8ae08582f63ab5f725a95a1e..9420318fa90e439a96c3f9ba34be637c7128cad1 100644 (file)
@@ -335,7 +335,7 @@ static int ldb_autotransaction_request(struct ldb_context *ldb, struct ldb_reque
 
        ret = ldb_request(ldb, req);
        if (ret == LDB_SUCCESS) {
-               ret = ldb_wait(req->async.handle, LDB_WAIT_ALL);
+               ret = ldb_wait(req->handle, LDB_WAIT_ALL);
        }
 
        if (ret == LDB_SUCCESS) {
@@ -369,11 +369,11 @@ int ldb_set_timeout(struct ldb_context *ldb, struct ldb_request *req, int timeou
        if (req == NULL) return LDB_ERR_OPERATIONS_ERROR;
        
        if (timeout != 0) {
-               req->async.timeout = timeout;
+               req->timeout = timeout;
        } else {
-               req->async.timeout = ldb->default_timeout;
+               req->timeout = ldb->default_timeout;
        }
-       req->async.starttime = time(NULL);
+       req->starttime = time(NULL);
 
        return LDB_SUCCESS;
 }
@@ -390,11 +390,11 @@ int ldb_set_timeout_from_prev_req(struct ldb_context *ldb, struct ldb_request *o
        if (oldreq == NULL)
                return ldb_set_timeout(ldb, newreq, 0);
 
-       if ((now - oldreq->async.starttime) > oldreq->async.timeout) {
+       if ((now - oldreq->starttime) > oldreq->timeout) {
                return LDB_ERR_TIME_LIMIT_EXCEEDED;
        }
-       newreq->async.starttime = oldreq->async.starttime;
-       newreq->async.timeout = oldreq->async.timeout - (now - oldreq->async.starttime);
+       newreq->starttime = oldreq->starttime;
+       newreq->timeout = oldreq->timeout - (now - oldreq->starttime);
 
        return LDB_SUCCESS;
 }
@@ -556,14 +556,14 @@ int ldb_search(struct ldb_context *ldb,
 
        req->op.search.attrs = attrs;
        req->controls = NULL;
-       req->async.context = res;
-       req->async.callback = ldb_search_callback;
+       req->context = res;
+       req->callback = ldb_search_callback;
        ldb_set_timeout(ldb, req, 0); /* use default timeout */
 
        ret = ldb_request(ldb, req);
        
        if (ret == LDB_SUCCESS) {
-               ret = ldb_wait(req->async.handle, LDB_WAIT_ALL);
+               ret = ldb_wait(req->handle, LDB_WAIT_ALL);
        }
        
        if (ret != LDB_SUCCESS) {
@@ -600,8 +600,8 @@ int ldb_add(struct ldb_context *ldb,
        req->operation = LDB_ADD;
        req->op.add.message = message;
        req->controls = NULL;
-       req->async.context = NULL;
-       req->async.callback = NULL;
+       req->context = NULL;
+       req->callback = NULL;
        ldb_set_timeout(ldb, req, 0); /* use default timeout */
 
        /* do request and autostart a transaction */
@@ -632,8 +632,8 @@ int ldb_modify(struct ldb_context *ldb,
        req->operation = LDB_MODIFY;
        req->op.add.message = message;
        req->controls = NULL;
-       req->async.context = NULL;
-       req->async.callback = NULL;
+       req->context = NULL;
+       req->callback = NULL;
        ldb_set_timeout(ldb, req, 0); /* use default timeout */
 
        /* do request and autostart a transaction */
@@ -661,8 +661,8 @@ int ldb_delete(struct ldb_context *ldb, const struct ldb_dn *dn)
        req->operation = LDB_DELETE;
        req->op.del.dn = dn;
        req->controls = NULL;
-       req->async.context = NULL;
-       req->async.callback = NULL;
+       req->context = NULL;
+       req->callback = NULL;
        ldb_set_timeout(ldb, req, 0); /* use default timeout */
 
        /* do request and autostart a transaction */
@@ -690,8 +690,8 @@ int ldb_rename(struct ldb_context *ldb, const struct ldb_dn *olddn, const struct
        req->op.rename.olddn = olddn;
        req->op.rename.newdn = newdn;
        req->controls = NULL;
-       req->async.context = NULL;
-       req->async.callback = NULL;
+       req->context = NULL;
+       req->callback = NULL;
        ldb_set_timeout(ldb, req, 0); /* use default timeout */
 
        /* do request and autostart a transaction */
@@ -718,8 +718,8 @@ int ldb_sequence_number(struct ldb_context *ldb, uint64_t *seq_num)
 
        req->operation = LDB_SEQUENCE_NUMBER;
        req->controls = NULL;
-       req->async.context = NULL;
-       req->async.callback = NULL;
+       req->context = NULL;
+       req->callback = NULL;
        ldb_set_timeout(ldb, req, 0); /* use default timeout */
 
        /* do request and autostart a transaction */
index 885842ff9ce6e02ad23a9e1741c969c760a53f54..68c2272adf57afb05c3bcf5d55a2d621644d6785 100644 (file)
@@ -664,14 +664,12 @@ struct ldb_request {
 
        struct ldb_control **controls;
 
-       struct {
-               void *context;
-               int (*callback)(struct ldb_context *, void *, struct ldb_reply *);
-
-               int timeout;
-               time_t starttime;
-               struct ldb_handle *handle;
-       } async;
+       void *context;
+       int (*callback)(struct ldb_context *, void *, struct ldb_reply *);
+
+       int timeout;
+       time_t starttime;
+       struct ldb_handle *handle;
 };
 
 int ldb_request(struct ldb_context *ldb, struct ldb_request *request);
index 3410d68c5ee70741400419f26c99ed911f62ced0..ae92ede8ce46f5205756e52613a78d26eb7c1108 100644 (file)
@@ -391,9 +391,9 @@ static int ildb_search(struct ldb_module *module, struct ldb_request *req)
        struct ldap_message *msg;
        int n;
 
-       req->async.handle = NULL;
+       req->handle = NULL;
 
-       if (!req->async.callback || !req->async.context) {
+       if (!req->callback || !req->context) {
                ldb_set_errstring(module->ldb, talloc_asprintf(module, "Async interface called with NULL callback function or NULL context"));
                return LDB_ERR_OPERATIONS_ERROR;
        }
@@ -444,7 +444,7 @@ static int ildb_search(struct ldb_module *module, struct ldb_request *req)
        msg->r.SearchRequest.attributes = discard_const(req->op.search.attrs);
        msg->controls = req->controls;
 
-       return ildb_request_send(module, msg, req->async.context, req->async.callback, req->async.timeout, &(req->async.handle));
+       return ildb_request_send(module, msg, req->context, req->callback, req->timeout, &(req->handle));
 }
 
 /*
@@ -457,7 +457,7 @@ static int ildb_add(struct ldb_module *module, struct ldb_request *req)
        struct ldap_mod **mods;
        int i,n;
 
-       req->async.handle = NULL;
+       req->handle = NULL;
 
        /* ignore ltdb specials */
        if (ldb_dn_is_special(req->op.add.message->dn)) {
@@ -494,7 +494,7 @@ static int ildb_add(struct ldb_module *module, struct ldb_request *req)
                msg->r.AddRequest.attributes[i] = mods[i]->attrib;
        }
 
-       return ildb_request_send(module, msg, req->async.context, req->async.callback, req->async.timeout, &(req->async.handle));
+       return ildb_request_send(module, msg, req->context, req->callback, req->timeout, &(req->handle));
 }
 
 /*
@@ -507,7 +507,7 @@ static int ildb_modify(struct ldb_module *module, struct ldb_request *req)
        struct ldap_mod **mods;
        int i,n;
 
-       req->async.handle = NULL;
+       req->handle = NULL;
 
        /* ignore ltdb specials */
        if (ldb_dn_is_special(req->op.mod.message->dn)) {
@@ -544,11 +544,7 @@ static int ildb_modify(struct ldb_module *module, struct ldb_request *req)
                msg->r.ModifyRequest.mods[i] = *mods[i];
        }
 
-       return ildb_request_send(module, msg,
-                               req->async.context,
-                               req->async.callback,
-                               req->async.timeout,
-                               &(req->async.handle));
+       return ildb_request_send(module, msg, req->context, req->callback, req->timeout, &(req->handle));
 }
 
 /*
@@ -559,7 +555,7 @@ static int ildb_delete(struct ldb_module *module, struct ldb_request *req)
        struct ildb_private *ildb = talloc_get_type(module->private_data, struct ildb_private);
        struct ldap_message *msg;
 
-       req->async.handle = NULL;
+       req->handle = NULL;
 
        /* ignore ltdb specials */
        if (ldb_dn_is_special(req->op.del.dn)) {
@@ -579,11 +575,7 @@ static int ildb_delete(struct ldb_module *module, struct ldb_request *req)
                return LDB_ERR_INVALID_DN_SYNTAX;
        }
 
-       return ildb_request_send(module, msg,
-                               req->async.context,
-                               req->async.callback,
-                               req->async.timeout,
-                               &(req->async.handle));
+       return ildb_request_send(module, msg, req->context, req->callback, req->timeout, &(req->handle));
 }
 
 /*
@@ -594,7 +586,7 @@ static int ildb_rename(struct ldb_module *module, struct ldb_request *req)
        struct ildb_private *ildb = talloc_get_type(module->private_data, struct ildb_private);
        struct ldap_message *msg;
 
-       req->async.handle = NULL;
+       req->handle = NULL;
 
        /* ignore ltdb specials */
        if (ldb_dn_is_special(req->op.rename.olddn) || ldb_dn_is_special(req->op.rename.newdn)) {
@@ -632,11 +624,7 @@ static int ildb_rename(struct ldb_module *module, struct ldb_request *req)
 
        msg->r.ModifyDNRequest.deleteolddn = True;
 
-       return ildb_request_send(module, msg,
-                               req->async.context,
-                               req->async.callback,
-                               req->async.timeout,
-                               &(req->async.handle));
+       return ildb_request_send(module, msg, req->context, req->callback, req->timeout, &(req->handle));
 }
 
 static int ildb_start_trans(struct ldb_module *module)
@@ -757,8 +745,8 @@ static int ildb_init(struct ldb_module *module)
        req->op.search.tree = ldb_parse_tree(req, "dn=dc=rootDSE");
        req->op.search.attrs = NULL;
        req->controls = NULL;
-       req->async.context = ildb;
-       req->async.callback = ildb_rootdse_callback;
+       req->context = ildb;
+       req->callback = ildb_rootdse_callback;
        ldb_set_timeout(module->ldb, req, 60);
 
        ret = ildb_search(module, req);
@@ -767,7 +755,7 @@ static int ildb_init(struct ldb_module *module)
                return ret;
        }
 
-       ret = ildb_wait(req->async.handle, LDB_WAIT_ALL);
+       ret = ildb_wait(req->handle, LDB_WAIT_ALL);
        
        talloc_free(req);
        return ret;
index f6d24411db909a756774ee5887a0cf8d11a8a7fb..1a20a285909b5d3554c70d1fa1c7e54ce9d3bc61 100644 (file)
@@ -236,7 +236,7 @@ static int lldb_search(struct ldb_module *module, struct ldb_request *req)
        char *expression;
        int ret;
 
-       if (!req->async.callback || !req->async.context) {
+       if (!req->callback || !req->context) {
                ldb_set_errstring(module->ldb, talloc_asprintf(module, "Async interface called with NULL callback function or NULL context"));
                return LDB_ERR_OPERATIONS_ERROR;
        }
@@ -250,12 +250,12 @@ static int lldb_search(struct ldb_module *module, struct ldb_request *req)
                ldb_debug(module->ldb, LDB_DEBUG_WARNING, "Controls are not yet supported by ldb_ldap backend!\n");
        }
 
-       req->async.handle = init_handle(lldb, module, req->async.context, req->async.callback, req->async.timeout, req->async.starttime);
-       if (req->async.handle == NULL) {
+       req->handle = init_handle(lldb, module, req->context, req->callback, req->timeout, req->starttime);
+       if (req->handle == NULL) {
                return LDB_ERR_OPERATIONS_ERROR;
        }
 
-       lldb_ac = talloc_get_type(req->async.handle->private_data, struct lldb_context);
+       lldb_ac = talloc_get_type(req->handle->private_data, struct lldb_context);
 
        search_base = ldb_dn_linearize(lldb_ac, req->op.search.base);
        if (req->op.search.base == NULL) {
@@ -282,7 +282,7 @@ static int lldb_search(struct ldb_module *module, struct ldb_request *req)
                break;
        }
 
-       tv.tv_sec = req->async.timeout;
+       tv.tv_sec = req->timeout;
        tv.tv_usec = 0;
 
        ret = ldap_search_ext(lldb->ldap, search_base, ldap_scope, 
@@ -318,12 +318,12 @@ static int lldb_add(struct ldb_module *module, struct ldb_request *req)
                return LDB_ERR_INVALID_DN_SYNTAX;
        }
 
-       req->async.handle = init_handle(lldb, module, req->async.context, req->async.callback, req->async.timeout, req->async.starttime);
-       if (req->async.handle == NULL) {
+       req->handle = init_handle(lldb, module, req->context, req->callback, req->timeout, req->starttime);
+       if (req->handle == NULL) {
                return LDB_ERR_OPERATIONS_ERROR;
        }
 
-       lldb_ac = talloc_get_type(req->async.handle->private_data, struct lldb_context);
+       lldb_ac = talloc_get_type(req->handle->private_data, struct lldb_context);
 
        mods = lldb_msg_to_mods(lldb_ac, req->op.add.message, 0);
        if (mods == NULL) {
@@ -363,12 +363,12 @@ static int lldb_modify(struct ldb_module *module, struct ldb_request *req)
                return LDB_ERR_INVALID_DN_SYNTAX;
        }
 
-       req->async.handle = init_handle(lldb, module, req->async.context, req->async.callback, req->async.timeout, req->async.starttime);
-       if (req->async.handle == NULL) {
+       req->handle = init_handle(lldb, module, req->context, req->callback, req->timeout, req->starttime);
+       if (req->handle == NULL) {
                return LDB_ERR_OPERATIONS_ERROR;
        }
 
-       lldb_ac = talloc_get_type(req->async.handle->private_data, struct lldb_context);
+       lldb_ac = talloc_get_type(req->handle->private_data, struct lldb_context);
 
        mods = lldb_msg_to_mods(lldb_ac, req->op.mod.message, 1);
        if (mods == NULL) {
@@ -407,12 +407,12 @@ static int lldb_delete(struct ldb_module *module, struct ldb_request *req)
                return LDB_ERR_INVALID_DN_SYNTAX;
        }
 
-       req->async.handle = init_handle(lldb, module, req->async.context, req->async.callback, req->async.timeout, req->async.starttime);
-       if (req->async.handle == NULL) {
+       req->handle = init_handle(lldb, module, req->context, req->callback, req->timeout, req->starttime);
+       if (req->handle == NULL) {
                return LDB_ERR_OPERATIONS_ERROR;
        }
 
-       lldb_ac = talloc_get_type(req->async.handle->private_data, struct lldb_context);
+       lldb_ac = talloc_get_type(req->handle->private_data, struct lldb_context);
 
        dnstr = ldb_dn_linearize(lldb_ac, req->op.del.dn);
 
@@ -445,12 +445,12 @@ static int lldb_rename(struct ldb_module *module, struct ldb_request *req)
                return LDB_ERR_INVALID_DN_SYNTAX;
        }
 
-       req->async.handle = init_handle(lldb, module, req->async.context, req->async.callback, req->async.timeout, req->async.starttime);
-       if (req->async.handle == NULL) {
+       req->handle = init_handle(lldb, module, req->context, req->callback, req->timeout, req->starttime);
+       if (req->handle == NULL) {
                return LDB_ERR_OPERATIONS_ERROR;
        }
 
-       lldb_ac = talloc_get_type(req->async.handle->private_data, struct lldb_context);
+       lldb_ac = talloc_get_type(req->handle->private_data, struct lldb_context);
 
        old_dn = ldb_dn_linearize(lldb_ac, req->op.rename.olddn);
        if (old_dn == NULL) {
index c2ac9f47f4f37c7d87058c5e3af4ae9b34e4e2cb..153a6d27d4804c74b87bfe8723b3062aa6b46609 100644 (file)
@@ -2018,38 +2018,38 @@ static int lsql_request(struct ldb_module *module, struct ldb_request *req)
                                        req->op.search.scope, 
                                        req->op.search.tree, 
                                        req->op.search.attrs,
-                                       req->async.context,
-                                       req->async.callback,
-                                       &req->async.handle);
+                                       req->context,
+                                       req->callback,
+                                       &req->handle);
 /*
        case LDB_ADD:
                return lsql_add_async(module,
                                        req->op.add.message,
-                                       req->async.context,
-                                       req->async.callback,
-                                       &req->async.handle);
+                                       req->context,
+                                       req->callback,
+                                       &req->handle);
 
        case LDB_MODIFY:
                return lsql_modify_async(module,
                                        req->op.mod.message,
-                                       req->async.context,
-                                       req->async.callback,
-                                       &req->async.handle);
+                                       req->context,
+                                       req->callback,
+                                       &req->handle);
 */
        case LDB_DELETE:
                return lsql_delete_async(module,
                                        req->op.del.dn,
-                                       req->async.context,
-                                       req->async.callback,
-                                       &req->async.handle);
+                                       req->context,
+                                       req->callback,
+                                       &req->handle);
 
        case LDB_RENAME:
                return lsql_rename_async(module,
                                        req->op.rename.olddn,
                                        req->op.rename.newdn,
-                                       req->async.context,
-                                       req->async.callback,
-                                       &req->async.handle);
+                                       req->context,
+                                       req->callback,
+                                       &req->handle);
 
        default:
                return LDB_ERR_OPERATIONS_ERROR;
index 62e310ede65b2f8c34683ddffb6313d0eecac593..ad6f98ea974aa65133b02efa9e24fed3980f5970 100644 (file)
@@ -498,27 +498,27 @@ int ltdb_search(struct ldb_module *module, struct ldb_request *req)
                return LDB_ERR_OPERATIONS_ERROR;
        }
 
-       req->async.handle = init_ltdb_handle(ltdb, module, req->async.context, req->async.callback);
-       if (req->async.handle == NULL) {
+       req->handle = init_ltdb_handle(ltdb, module, req->context, req->callback);
+       if (req->handle == NULL) {
                ltdb_unlock_read(module);
                return LDB_ERR_OPERATIONS_ERROR;
        }
 
-       ltdb_ac = talloc_get_type(req->async.handle->private_data, struct ltdb_context);
+       ltdb_ac = talloc_get_type(req->handle->private_data, struct ltdb_context);
 
        ltdb_ac->tree = req->op.search.tree;
        ltdb_ac->scope = req->op.search.scope;
        ltdb_ac->base = req->op.search.base;
        ltdb_ac->attrs = req->op.search.attrs;
 
-       ret = ltdb_search_indexed(req->async.handle);
+       ret = ltdb_search_indexed(req->handle);
        if (ret == -1) {
-               ret = ltdb_search_full(req->async.handle);
+               ret = ltdb_search_full(req->handle);
        }
        if (ret != LDB_SUCCESS) {
                ldb_set_errstring(module->ldb, talloc_strdup(module->ldb, "Indexed and full searches both failed!\n"));
-               req->async.handle->state = LDB_ASYNC_DONE;
-               req->async.handle->status = ret;
+               req->handle->state = LDB_ASYNC_DONE;
+               req->handle->status = ret;
        }
 
        ltdb_unlock_read(module);
index ababedad1572eef02523aabdf7e386c1834425ab..1401052955a3b6a2272e0e8a7c8d2cf87ea754da 100644 (file)
@@ -298,15 +298,15 @@ static int ltdb_add(struct ldb_module *module, struct ldb_request *req)
                }
        }
        
-       req->async.handle = init_ltdb_handle(ltdb, module, req->async.context, req->async.callback);
-       if (req->async.handle == NULL) {
+       req->handle = init_ltdb_handle(ltdb, module, req->context, req->callback);
+       if (req->handle == NULL) {
                return LDB_ERR_OPERATIONS_ERROR;
        }
-       ltdb_ac = talloc_get_type(req->async.handle->private_data, struct ltdb_context);
+       ltdb_ac = talloc_get_type(req->handle->private_data, struct ltdb_context);
 
        tret = ltdb_add_internal(module, req->op.add.message);
        if (tret != LDB_SUCCESS) {
-               req->async.handle->status = tret;
+               req->handle->status = tret;
                goto done;
        }
        
@@ -314,7 +314,7 @@ static int ltdb_add(struct ldb_module *module, struct ldb_request *req)
                ret = ltdb_ac->callback(module->ldb, ltdb_ac->context, NULL);
        }
 done:
-       req->async.handle->state = LDB_ASYNC_DONE;
+       req->handle->state = LDB_ASYNC_DONE;
        return ret;
 }
 
@@ -400,21 +400,21 @@ static int ltdb_delete(struct ldb_module *module, struct ldb_request *req)
                }
        }
        
-       req->async.handle = NULL;
+       req->handle = NULL;
 
        if (ltdb_cache_load(module) != 0) {
                return LDB_ERR_OPERATIONS_ERROR;
        }
 
-       req->async.handle = init_ltdb_handle(ltdb, module, req->async.context, req->async.callback);
-       if (req->async.handle == NULL) {
+       req->handle = init_ltdb_handle(ltdb, module, req->context, req->callback);
+       if (req->handle == NULL) {
                return LDB_ERR_OPERATIONS_ERROR;
        }
-       ltdb_ac = talloc_get_type(req->async.handle->private_data, struct ltdb_context);
+       ltdb_ac = talloc_get_type(req->handle->private_data, struct ltdb_context);
 
        tret = ltdb_delete_internal(module, req->op.del.dn);
        if (tret != LDB_SUCCESS) {
-               req->async.handle->status = tret; 
+               req->handle->status = tret; 
                goto done;
        }
 
@@ -422,7 +422,7 @@ static int ltdb_delete(struct ldb_module *module, struct ldb_request *req)
                ret = ltdb_ac->callback(module->ldb, ltdb_ac->context, NULL);
        }
 done:
-       req->async.handle->state = LDB_ASYNC_DONE;
+       req->handle->state = LDB_ASYNC_DONE;
        return ret;
 }
 
@@ -764,17 +764,17 @@ static int ltdb_modify(struct ldb_module *module, struct ldb_request *req)
                }
        }
        
-       req->async.handle = NULL;
+       req->handle = NULL;
 
-       req->async.handle = init_ltdb_handle(ltdb, module, req->async.context, req->async.callback);
-       if (req->async.handle == NULL) {
+       req->handle = init_ltdb_handle(ltdb, module, req->context, req->callback);
+       if (req->handle == NULL) {
                return LDB_ERR_OPERATIONS_ERROR;
        }
-       ltdb_ac = talloc_get_type(req->async.handle->private_data, struct ltdb_context);
+       ltdb_ac = talloc_get_type(req->handle->private_data, struct ltdb_context);
 
        tret = ltdb_check_special_dn(module, req->op.mod.message);
        if (tret != LDB_SUCCESS) {
-               req->async.handle->status = tret;
+               req->handle->status = tret;
                goto done;
        }
        
@@ -785,7 +785,7 @@ static int ltdb_modify(struct ldb_module *module, struct ldb_request *req)
 
        tret = ltdb_modify_internal(module, req->op.mod.message);
        if (tret != LDB_SUCCESS) {
-               req->async.handle->status = tret;
+               req->handle->status = tret;
                goto done;
        }
 
@@ -793,7 +793,7 @@ static int ltdb_modify(struct ldb_module *module, struct ldb_request *req)
                ret = ltdb_ac->callback(module->ldb, ltdb_ac->context, NULL);
        }
 done:
-       req->async.handle->state = LDB_ASYNC_DONE;
+       req->handle->state = LDB_ASYNC_DONE;
        return ret;
 }
 
@@ -814,17 +814,17 @@ static int ltdb_rename(struct ldb_module *module, struct ldb_request *req)
                }
        }
        
-       req->async.handle = NULL;
+       req->handle = NULL;
 
        if (ltdb_cache_load(module) != 0) {
                return LDB_ERR_OPERATIONS_ERROR;
        }
 
-       req->async.handle = init_ltdb_handle(ltdb, module, req->async.context, req->async.callback);
-       if (req->async.handle == NULL) {
+       req->handle = init_ltdb_handle(ltdb, module, req->context, req->callback);
+       if (req->handle == NULL) {
                return LDB_ERR_OPERATIONS_ERROR;
        }
-       ltdb_ac = talloc_get_type(req->async.handle->private_data, struct ltdb_context);
+       ltdb_ac = talloc_get_type(req->handle->private_data, struct ltdb_context);
 
        msg = talloc(ltdb_ac, struct ldb_message);
        if (msg == NULL) {
@@ -837,7 +837,7 @@ static int ltdb_rename(struct ldb_module *module, struct ldb_request *req)
        tret = ltdb_search_dn1(module, req->op.rename.olddn, msg);
        if (tret != 1) {
                /* not finding the old record is an error */
-               req->async.handle->status = LDB_ERR_NO_SUCH_OBJECT;
+               req->handle->status = LDB_ERR_NO_SUCH_OBJECT;
                goto done;
        }
 
@@ -864,7 +864,7 @@ static int ltdb_rename(struct ldb_module *module, struct ldb_request *req)
                ret = ltdb_ac->callback(module->ldb, ltdb_ac->context, NULL);
        }
 done:
-       req->async.handle->state = LDB_ASYNC_DONE;
+       req->handle->state = LDB_ASYNC_DONE;
        return ret;
 }
 
index 466286e8cdf76a708924fe52c7d732cbc76b4d9f..110470c8bb6d8307740b314d72315466963e7a90 100644 (file)
@@ -217,9 +217,9 @@ static int asq_search(struct ldb_module *module, struct ldb_request *req)
                return ldb_next_request(module, req);
        }
 
-       req->async.handle = NULL;
+       req->handle = NULL;
 
-       if (!req->async.callback || !req->async.context) {
+       if (!req->callback || !req->context) {
                ldb_set_errstring(module->ldb, talloc_asprintf(module,
                                  "Async interface called with NULL callback function or NULL context"));
                return LDB_ERR_OPERATIONS_ERROR;
@@ -230,13 +230,13 @@ static int asq_search(struct ldb_module *module, struct ldb_request *req)
                return LDB_ERR_PROTOCOL_ERROR;
        }
 
-       h = init_handle(req, module, req->async.context, req->async.callback);
+       h = init_handle(req, module, req->context, req->callback);
        if (!h) {
                return LDB_ERR_OPERATIONS_ERROR;
        }
        ac = talloc_get_type(h->private_data, struct asq_context);
 
-       req->async.handle = h;
+       req->handle = h;
 
        /* check the search is well formed */
        if (req->op.search.scope != LDB_SCOPE_BASE) {
@@ -266,8 +266,8 @@ static int asq_search(struct ldb_module *module, struct ldb_request *req)
        base_attrs[1] = NULL;
        ac->base_req->op.search.attrs = (const char * const *)base_attrs;
 
-       ac->base_req->async.context = ac;
-       ac->base_req->async.callback = asq_base_callback;
+       ac->base_req->context = ac;
+       ac->base_req->callback = asq_base_callback;
        ldb_set_timeout_from_prev_req(module->ldb, req, ac->base_req);
 
        ac->step = ASQ_SEARCH_BASE;
@@ -319,8 +319,8 @@ static int asq_requests(struct ldb_handle *handle) {
                ac->reqs[i]->op.search.tree = ac->base_req->op.search.tree;
                ac->reqs[i]->op.search.attrs = ac->req_attrs;
 
-               ac->reqs[i]->async.context = ac;
-               ac->reqs[i]->async.callback = asq_reqs_callback;
+               ac->reqs[i]->context = ac;
+               ac->reqs[i]->callback = asq_reqs_callback;
                ldb_set_timeout_from_prev_req(ac->module->ldb, ac->base_req, ac->reqs[i]);
        }
 
@@ -350,18 +350,18 @@ static int asq_wait_none(struct ldb_handle *handle)
 
        switch (ac->step) {
        case ASQ_SEARCH_BASE:
-               ret = ldb_wait(ac->base_req->async.handle, LDB_WAIT_NONE);
+               ret = ldb_wait(ac->base_req->handle, LDB_WAIT_NONE);
                
                if (ret != LDB_SUCCESS) {
                        handle->status = ret;
                        goto done;
                }
 
-               if (ac->base_req->async.handle->status != LDB_SUCCESS) {
-                       handle->status = ac->base_req->async.handle->status;
+               if (ac->base_req->handle->status != LDB_SUCCESS) {
+                       handle->status = ac->base_req->handle->status;
                        goto done;
                }
-               if (ac->base_req->async.handle->state != LDB_ASYNC_DONE) {
+               if (ac->base_req->handle->state != LDB_ASYNC_DONE) {
                        return LDB_SUCCESS;
                }
 
@@ -369,24 +369,24 @@ static int asq_wait_none(struct ldb_handle *handle)
 
        case ASQ_SEARCH_MULTI:
 
-               if (ac->reqs[ac->cur_req]->async.handle == NULL) {
+               if (ac->reqs[ac->cur_req]->handle == NULL) {
                        ret = ldb_request(ac->module->ldb, ac->reqs[ac->cur_req]);
                        if (ret != LDB_SUCCESS) {
                                return ret;
                        }
                }
 
-               ret = ldb_wait(ac->reqs[ac->cur_req]->async.handle, LDB_WAIT_NONE);
+               ret = ldb_wait(ac->reqs[ac->cur_req]->handle, LDB_WAIT_NONE);
                
                if (ret != LDB_SUCCESS) {
                        handle->status = ret;
                        goto done;
                }
-               if (ac->reqs[ac->cur_req]->async.handle->status != LDB_SUCCESS) {
-                       handle->status = ac->reqs[ac->cur_req]->async.handle->status;
+               if (ac->reqs[ac->cur_req]->handle->status != LDB_SUCCESS) {
+                       handle->status = ac->reqs[ac->cur_req]->handle->status;
                }
 
-               if (ac->reqs[ac->cur_req]->async.handle->state == LDB_ASYNC_DONE) {
+               if (ac->reqs[ac->cur_req]->handle->state == LDB_ASYNC_DONE) {
                        ac->cur_req++;
                }
 
index 03ff58e994d2aec9687ee69bf60d23a4376bfc45..a8c99226cd815c1287aa8d30e347f91d25e687e3 100644 (file)
@@ -283,7 +283,7 @@ static int objectclass_add(struct ldb_module *module, struct ldb_request *req)
        /* do not free down_req as the call results may be linked to it,
         * it will be freed when the upper level request get freed */
        if (ret == LDB_SUCCESS) {
-               req->async.handle = down_req->async.handle;
+               req->handle = down_req->handle;
        }
        return ret;
 }
@@ -382,7 +382,7 @@ static int objectclass_modify(struct ldb_module *module, struct ldb_request *req
                /* do not free down_req as the call results may be linked to it,
                 * it will be freed when the upper level request get freed */
                if (ret == LDB_SUCCESS) {
-                       req->async.handle = down_req->async.handle;
+                       req->handle = down_req->handle;
                }
                return ret;
        }
@@ -399,7 +399,7 @@ static int objectclass_modify(struct ldb_module *module, struct ldb_request *req
                ac = talloc_get_type(h->private_data, struct oc_context);
                
                /* return or own handle to deal with this call */
-               req->async.handle = h;
+               req->handle = h;
                
                /* prepare the first operation */
                ac->down_req = talloc(ac, struct ldb_request);
@@ -410,8 +410,8 @@ static int objectclass_modify(struct ldb_module *module, struct ldb_request *req
                
                *(ac->down_req) = *req; /* copy the request */
                
-               ac->down_req->async.context = NULL;
-               ac->down_req->async.callback = NULL;
+               ac->down_req->context = NULL;
+               ac->down_req->callback = NULL;
                ldb_set_timeout_from_prev_req(module->ldb, req, ac->down_req);
                
                ac->step = OC_DO_REQ;
@@ -471,8 +471,8 @@ static int objectclass_search_self(struct ldb_handle *h) {
        }
        ac->search_req->op.search.attrs = attrs;
        ac->search_req->controls = NULL;
-       ac->search_req->async.context = ac;
-       ac->search_req->async.callback = get_self_callback;
+       ac->search_req->context = ac;
+       ac->search_req->callback = get_self_callback;
        ldb_set_timeout_from_prev_req(ac->module->ldb, ac->orig_req, ac->search_req);
 
        ac->step = OC_SEARCH_SELF;
@@ -504,8 +504,8 @@ static int objectclass_do_mod(struct ldb_handle *h) {
 
        ac->mod_req->operation = LDB_MODIFY;
        ac->mod_req->controls = NULL;
-       ac->mod_req->async.context = ac;
-       ac->mod_req->async.callback = NULL;
+       ac->mod_req->context = ac;
+       ac->mod_req->callback = NULL;
        ldb_set_timeout_from_prev_req(ac->module->ldb, ac->orig_req, ac->mod_req);
        
        /* use a new message structure */
@@ -590,18 +590,18 @@ static int oc_wait(struct ldb_handle *handle) {
 
        switch (ac->step) {
        case OC_DO_REQ:
-               ret = ldb_wait(ac->down_req->async.handle, LDB_WAIT_NONE);
+               ret = ldb_wait(ac->down_req->handle, LDB_WAIT_NONE);
 
                if (ret != LDB_SUCCESS) {
                        handle->status = ret;
                        goto done;
                }
-               if (ac->down_req->async.handle->status != LDB_SUCCESS) {
-                       handle->status = ac->down_req->async.handle->status;
+               if (ac->down_req->handle->status != LDB_SUCCESS) {
+                       handle->status = ac->down_req->handle->status;
                        goto done;
                }
 
-               if (ac->down_req->async.handle->state != LDB_ASYNC_DONE) {
+               if (ac->down_req->handle->state != LDB_ASYNC_DONE) {
                        return LDB_SUCCESS;
                }
 
@@ -609,18 +609,18 @@ static int oc_wait(struct ldb_handle *handle) {
                return objectclass_search_self(handle);
 
        case OC_SEARCH_SELF:
-               ret = ldb_wait(ac->search_req->async.handle, LDB_WAIT_NONE);
+               ret = ldb_wait(ac->search_req->handle, LDB_WAIT_NONE);
 
                if (ret != LDB_SUCCESS) {
                        handle->status = ret;
                        goto done;
                }
-               if (ac->search_req->async.handle->status != LDB_SUCCESS) {
-                       handle->status = ac->search_req->async.handle->status;
+               if (ac->search_req->handle->status != LDB_SUCCESS) {
+                       handle->status = ac->search_req->handle->status;
                        goto done;
                }
 
-               if (ac->search_req->async.handle->state != LDB_ASYNC_DONE) {
+               if (ac->search_req->handle->state != LDB_ASYNC_DONE) {
                        return LDB_SUCCESS;
                }
 
@@ -628,18 +628,18 @@ static int oc_wait(struct ldb_handle *handle) {
                return objectclass_do_mod(handle);
 
        case OC_DO_MOD:
-               ret = ldb_wait(ac->mod_req->async.handle, LDB_WAIT_NONE);
+               ret = ldb_wait(ac->mod_req->handle, LDB_WAIT_NONE);
 
                if (ret != LDB_SUCCESS) {
                        handle->status = ret;
                        goto done;
                }
-               if (ac->mod_req->async.handle->status != LDB_SUCCESS) {
-                       handle->status = ac->mod_req->async.handle->status;
+               if (ac->mod_req->handle->status != LDB_SUCCESS) {
+                       handle->status = ac->mod_req->handle->status;
                        goto done;
                }
 
-               if (ac->mod_req->async.handle->state != LDB_ASYNC_DONE) {
+               if (ac->mod_req->handle->state != LDB_ASYNC_DONE) {
                        return LDB_SUCCESS;
                }
 
index 4cadaa27ee0cb38de32e8bc4c6666a3b41345dda..7e7c8d83add506683b2e24521690dacbcc7e0575 100644 (file)
@@ -226,7 +226,7 @@ static int add_uint64_element(struct ldb_message *msg, const char *attr, uint64_
   hook search operations
 */
 
-struct operational_async_context {
+struct operational_context {
 
        struct ldb_module *module;
        void *up_context;
@@ -235,16 +235,16 @@ struct operational_async_context {
        const char * const *attrs;
 };
 
-static int operational_async_callback(struct ldb_context *ldb, void *context, struct ldb_reply *ares)
+static int operational_callback(struct ldb_context *ldb, void *context, struct ldb_reply *ares)
 {
-       struct operational_async_context *ac;
+       struct operational_context *ac;
 
        if (!context || !ares) {
                ldb_set_errstring(ldb, talloc_asprintf(ldb, "NULL Context or Result in callback"));
                goto error;
        }
 
-       ac = talloc_get_type(context, struct operational_async_context);
+       ac = talloc_get_type(context, struct operational_context);
 
        if (ares->type == LDB_REPLY_ENTRY) {
                /* for each record returned post-process to add any derived
@@ -263,21 +263,21 @@ error:
 
 static int operational_search(struct ldb_module *module, struct ldb_request *req)
 {
-       struct operational_async_context *ac;
+       struct operational_context *ac;
        struct ldb_request *down_req;
        const char **search_attrs = NULL;
        int i, a, ret;
 
-       req->async.handle = NULL;
+       req->handle = NULL;
 
-       ac = talloc(req, struct operational_async_context);
+       ac = talloc(req, struct operational_context);
        if (ac == NULL) {
                return LDB_ERR_OPERATIONS_ERROR;
        }
 
        ac->module = module;
-       ac->up_context = req->async.context;
-       ac->up_callback = req->async.callback;
+       ac->up_context = req->context;
+       ac->up_callback = req->callback;
        ac->attrs = req->op.search.attrs;
 
        down_req = talloc_zero(req, struct ldb_request);
@@ -325,8 +325,8 @@ static int operational_search(struct ldb_module *module, struct ldb_request *req
        
        down_req->controls = req->controls;
 
-       down_req->async.context = ac;
-       down_req->async.callback = operational_async_callback;
+       down_req->context = ac;
+       down_req->callback = operational_callback;
        ldb_set_timeout_from_prev_req(module->ldb, req, down_req);
 
        /* perform the search */
@@ -335,7 +335,7 @@ static int operational_search(struct ldb_module *module, struct ldb_request *req
        /* do not free down_req as the call results may be linked to it,
         * it will be freed when the upper level request get freed */
        if (ret == LDB_SUCCESS) {
-               req->async.handle = down_req->async.handle;
+               req->handle = down_req->handle;
        }
 
        return ret;
@@ -392,7 +392,7 @@ static int operational_add(struct ldb_module *module, struct ldb_request *req)
        /* do not free down_req as the call results may be linked to it,
         * it will be freed when the upper level request get freed */
        if (ret == LDB_SUCCESS) {
-               req->async.handle = down_req->async.handle;
+               req->handle = down_req->handle;
        }
 
        return ret;
@@ -449,7 +449,7 @@ static int operational_modify(struct ldb_module *module, struct ldb_request *req
        /* do not free down_req as the call results may be linked to it,
         * it will be freed when the upper level request get freed */
        if (ret == LDB_SUCCESS) {
-               req->async.handle = down_req->async.handle;
+               req->handle = down_req->handle;
        }
 
        return ret;
index 3f2ff66b3270c2e81e9c3796c6b8bd65a7ca0173..2d972b73164dad3f94f4130758047a63d295f96b 100644 (file)
@@ -251,9 +251,9 @@ static int paged_search(struct ldb_module *module, struct ldb_request *req)
 
        private_data = talloc_get_type(module->private_data, struct private_data);
 
-       req->async.handle = NULL;
+       req->handle = NULL;
 
-       if (!req->async.callback || !req->async.context) {
+       if (!req->callback || !req->context) {
                ldb_set_errstring(module->ldb, talloc_asprintf(module,
                                  "Async interface called with NULL callback function or NULL context"));
                return LDB_ERR_OPERATIONS_ERROR;
@@ -264,7 +264,7 @@ static int paged_search(struct ldb_module *module, struct ldb_request *req)
                return LDB_ERR_PROTOCOL_ERROR;
        }
 
-       h = init_handle(req, module, req->async.context, req->async.callback);
+       h = init_handle(req, module, req->context, req->callback);
        if (!h) {
                return LDB_ERR_OPERATIONS_ERROR;
        }
@@ -299,8 +299,8 @@ static int paged_search(struct ldb_module *module, struct ldb_request *req)
                        return LDB_ERR_OPERATIONS_ERROR;
                }
 
-               ac->store->req->async.context = ac;
-               ac->store->req->async.callback = paged_search_callback;
+               ac->store->req->context = ac;
+               ac->store->req->callback = paged_search_callback;
                ldb_set_timeout_from_prev_req(module->ldb, req, ac->store->req);
 
                ret = ldb_next_request(module, ac->store->req);
@@ -323,7 +323,7 @@ static int paged_search(struct ldb_module *module, struct ldb_request *req)
                ret = LDB_SUCCESS;
        }
 
-       req->async.handle = h;
+       req->handle = h;
 
        /* check if it is an abandon */
        if (ac->size == 0) {
@@ -463,7 +463,7 @@ static int paged_wait(struct ldb_handle *handle, enum ldb_wait_type type)
 
        ac = talloc_get_type(handle->private_data, struct paged_context);
 
-       if (ac->store->req->async.handle->state == LDB_ASYNC_DONE) {
+       if (ac->store->req->handle->state == LDB_ASYNC_DONE) {
                /* if lower level is finished we do not need to call it anymore */
                /* return all we have until size == 0 or we empty storage */
                ret = paged_results(handle);
@@ -478,8 +478,8 @@ static int paged_wait(struct ldb_handle *handle, enum ldb_wait_type type)
        }
 
        if (type == LDB_WAIT_ALL) {
-               while (ac->store->req->async.handle->state != LDB_ASYNC_DONE) {
-                       ret = ldb_wait(ac->store->req->async.handle, type);
+               while (ac->store->req->handle->state != LDB_ASYNC_DONE) {
+                       ret = ldb_wait(ac->store->req->handle, type);
                        if (ret != LDB_SUCCESS) {
                                handle->state = LDB_ASYNC_DONE;
                                handle->status = ret;
@@ -498,7 +498,7 @@ static int paged_wait(struct ldb_handle *handle, enum ldb_wait_type type)
                return ret;
        }
 
-       ret = ldb_wait(ac->store->req->async.handle, type);
+       ret = ldb_wait(ac->store->req->handle, type);
        if (ret != LDB_SUCCESS) {
                handle->state = LDB_ASYNC_DONE;
                handle->status = ret;
@@ -508,7 +508,7 @@ static int paged_wait(struct ldb_handle *handle, enum ldb_wait_type type)
        handle->status = ret;
 
        if (ac->store->num_entries >= ac->size ||
-           ac->store->req->async.handle->state == LDB_ASYNC_DONE) {
+           ac->store->req->handle->state == LDB_ASYNC_DONE) {
 
                ret = paged_results(handle);
 
index b005b49c5524830c77dc692c7cc63c04f7b094be..fce1d34ac0d139f13b32a6858d89ef10824c235c 100644 (file)
@@ -128,7 +128,7 @@ static int rdn_name_add(struct ldb_module *module, struct ldb_request *req)
        /* do not free down_req as the call results may be linked to it,
         * it will be freed when the upper level request get freed */
        if (ret == LDB_SUCCESS) {
-               req->async.handle = down_req->async.handle;
+               req->handle = down_req->handle;
        }
 
        return ret;
@@ -181,7 +181,7 @@ static int rdn_name_rename(struct ldb_module *module, struct ldb_request *req)
 
        ac->step = RENAME_RENAME;
 
-       req->async.handle = h;
+       req->handle = h;
 
        /* rename first, modify "name" if rename is ok */
        return ldb_next_request(module, ac->down_req);
@@ -254,17 +254,17 @@ static int rename_wait(struct ldb_handle *handle)
 
        switch(ac->step) {
        case RENAME_RENAME:
-               ret = ldb_wait(ac->down_req->async.handle, LDB_WAIT_NONE);
+               ret = ldb_wait(ac->down_req->handle, LDB_WAIT_NONE);
                if (ret != LDB_SUCCESS) {
                        handle->status = ret;
                        goto done;
                }
-               if (ac->down_req->async.handle->status != LDB_SUCCESS) {
-                       handle->status = ac->down_req->async.handle->status;
+               if (ac->down_req->handle->status != LDB_SUCCESS) {
+                       handle->status = ac->down_req->handle->status;
                        goto done;
                }
 
-               if (ac->down_req->async.handle->state != LDB_ASYNC_DONE) {
+               if (ac->down_req->handle->state != LDB_ASYNC_DONE) {
                        return LDB_SUCCESS;
                }
 
@@ -272,17 +272,17 @@ static int rename_wait(struct ldb_handle *handle)
                return rdn_name_rename_do_mod(handle);
 
        case RENAME_MODIFY:
-               ret = ldb_wait(ac->mod_req->async.handle, LDB_WAIT_NONE);
+               ret = ldb_wait(ac->mod_req->handle, LDB_WAIT_NONE);
                if (ret != LDB_SUCCESS) {
                        handle->status = ret;
                        goto done;
                }
-               if (ac->mod_req->async.handle->status != LDB_SUCCESS) {
-                       handle->status = ac->mod_req->async.handle->status;
+               if (ac->mod_req->handle->status != LDB_SUCCESS) {
+                       handle->status = ac->mod_req->handle->status;
                        goto done;
                }
 
-               if (ac->mod_req->async.handle->state != LDB_ASYNC_DONE) {
+               if (ac->mod_req->handle->state != LDB_ASYNC_DONE) {
                        return LDB_SUCCESS;
                }
 
index 261bae7e78c0f799cbfae9ce18292aa9880a16df..1ab034f4fb57e45a71c998da791f6c700af38254 100644 (file)
@@ -242,14 +242,14 @@ static int server_sort_search(struct ldb_module *module, struct ldb_request *req
                return ldb_next_request(module, req);
        }
 
-       req->async.handle = NULL;
+       req->handle = NULL;
 
-       if (!req->async.callback || !req->async.context) {
+       if (!req->callback || !req->context) {
                ldb_set_errstring(module->ldb, talloc_asprintf(module, "Async interface called with NULL callback function or NULL context"));
                return LDB_ERR_OPERATIONS_ERROR;
        }
        
-       h = init_handle(req, module, req->async.context, req->async.callback);
+       h = init_handle(req, module, req->context, req->callback);
        if (!h) {
                return LDB_ERR_OPERATIONS_ERROR;
        }
@@ -310,11 +310,11 @@ static int server_sort_search(struct ldb_module *module, struct ldb_request *req
                return LDB_ERR_OPERATIONS_ERROR;
        }
 
-       ac->req->async.context = ac;
-       ac->req->async.callback = server_sort_search_callback;
+       ac->req->context = ac;
+       ac->req->callback = server_sort_search_callback;
        ldb_set_timeout_from_prev_req(module->ldb, req, ac->req);
 
-       req->async.handle = h;
+       req->handle = h;
 
        return ldb_next_request(module, ac->req);
 }
@@ -398,15 +398,15 @@ static int server_sort_wait(struct ldb_handle *handle, enum ldb_wait_type type)
 
        ac = talloc_get_type(handle->private_data, struct sort_context);
 
-       ret = ldb_wait(ac->req->async.handle, type);
+       ret = ldb_wait(ac->req->handle, type);
 
        if (ret != LDB_SUCCESS) {
                handle->status = ret;
                return ret;
        }
                
-       handle->state = ac->req->async.handle->state;
-       handle->status = ac->req->async.handle->status;
+       handle->state = ac->req->handle->state;
+       handle->status = ac->req->handle->status;
 
        if (handle->status != LDB_SUCCESS) {
                return handle->status;
index 45826f09962d5c6f427073cb8c5f4e5cba22d586..93bb89a1d369e10cde04f771a9e2d786f93fe0a7 100644 (file)
@@ -224,8 +224,8 @@ static int do_search(struct ldb_context *ldb,
        if (req->op.search.tree == NULL) return -1;
        req->op.search.attrs = attrs;
        req->controls = sctx->req_ctrls;
-       req->async.context = sctx;
-       req->async.callback = &search_callback;
+       req->context = sctx;
+       req->callback = &search_callback;
        ldb_set_timeout(ldb, req, 0); /* TODO: make this settable by command line */
 
 again:
@@ -237,7 +237,7 @@ again:
                return -1;
        }
 
-       ret = ldb_wait(req->async.handle, LDB_WAIT_ALL);
+       ret = ldb_wait(req->handle, LDB_WAIT_ALL);
                if (ret != LDB_SUCCESS) {
                printf("search error - %s\n", ldb_errstring(ldb));
                return -1;
index 80fe3eab1cf39d72e4d124fe58b19a025840a895..068888bae9f183419bdb7c9d8d8856cbb30787fc 100644 (file)
@@ -231,8 +231,8 @@ static BOOL test_create_schema_type(struct ldb_context *ldb, struct test_rootDSE
        if (req->op.search.tree == NULL) return -1;
        req->op.search.attrs = NULL;
        req->controls = ctrl;
-       req->async.context = actx;
-       req->async.callback = test_schema_search_callback;
+       req->context = actx;
+       req->callback = test_schema_search_callback;
        ldb_set_timeout(ldb, req, 0);
 
        actx->count             = 0;
@@ -248,7 +248,7 @@ again:
                return False;
        }
 
-       ret = ldb_wait(req->async.handle, LDB_WAIT_ALL);
+       ret = ldb_wait(req->handle, LDB_WAIT_ALL);
                if (ret != LDB_SUCCESS) {
                d_printf("search error - %s\n", ldb_errstring(ldb));
                return False;