}
/* search */
-struct extended_async_context {
+struct extended_context {
struct ldb_module *module;
void *up_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
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;
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;
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 */
/* 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;
static const struct ldb_module_ops extended_dn_ops = {
.name = "extended_dn",
- .search = extended_search_async,
+ .search = extended_search,
.init_context = extended_init
};
}
/* search */
-struct kludge_acl_async_context {
+struct kludge_acl_context {
struct ldb_module *module;
void *up_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;
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
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);
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 */
/* 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;
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,
/* 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;
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);
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;
}
}
}
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;
ac->step = PH_ADD_SEARCH_DOM;
- req->async.handle = h;
+ req->handle = h;
return ldb_next_request(module, ac->dom_req);
}
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);
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;
}
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;
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;
}
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;
}
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;
}
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;
}
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;
}
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 *);
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
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;
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);
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 */
/* 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;
/* 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;
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);
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++) {
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) {
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;
}
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;
}
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) {
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 */
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 */
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 */
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 */
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 */
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);
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;
}
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));
}
/*
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)) {
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));
}
/*
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)) {
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));
}
/*
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)) {
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));
}
/*
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)) {
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)
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);
return ret;
}
- ret = ildb_wait(req->async.handle, LDB_WAIT_ALL);
+ ret = ildb_wait(req->handle, LDB_WAIT_ALL);
talloc_free(req);
return ret;
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;
}
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) {
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,
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) {
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) {
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);
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) {
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;
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);
}
}
- 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;
}
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;
}
}
}
- 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;
}
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;
}
}
}
- 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;
}
tret = ltdb_modify_internal(module, req->op.mod.message);
if (tret != LDB_SUCCESS) {
- req->async.handle->status = tret;
+ req->handle->status = tret;
goto done;
}
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;
}
}
}
- 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) {
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;
}
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;
}
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;
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) {
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;
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]);
}
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;
}
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++;
}
/* 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;
}
/* 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;
}
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);
*(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;
}
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;
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 */
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;
}
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;
}
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;
}
hook search operations
*/
-struct operational_async_context {
+struct operational_context {
struct ldb_module *module;
void *up_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
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);
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 */
/* 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;
/* 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;
/* 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;
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;
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;
}
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);
ret = LDB_SUCCESS;
}
- req->async.handle = h;
+ req->handle = h;
/* check if it is an abandon */
if (ac->size == 0) {
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);
}
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;
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;
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);
/* 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;
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);
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;
}
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;
}
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;
}
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);
}
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;
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:
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;
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;
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;