const char * const *attrs,
void *context,
int (*callback)(struct ldb_context *, void *, struct ldb_async_result *),
- int timeout,
struct ldb_async_handle **handle)
{
struct ltdb_private *ltdb = talloc_get_type(module->private_data, struct ltdb_private);
return LDB_ERR_OPERATIONS_ERROR;
}
- *handle = init_ltdb_handle(ltdb, module, context, callback, timeout);
+ *handle = init_ltdb_handle(ltdb, module, context, callback);
if (*handle == NULL) {
talloc_free(*handle);
ltdb_unlock_read(module);
ret = ltdb_search_async(module, base, scope, tree, attrs,
res, <db_search_sync_callback,
- 0, &handle);
+ &handle);
- if (ret != LDB_SUCCESS)
- return ret;
+ if (ret == LDB_SUCCESS) {
+ ret = ldb_async_wait(module->ldb, handle, LDB_WAIT_ALL);
+ talloc_free(handle);
+ }
- ret = ldb_async_wait(module->ldb, handle, LDB_WAIT_ALL);
+ if (ret != LDB_SUCCESS) {
+ talloc_free(*res);
+ }
- talloc_free(handle);
return ret;
}
struct ldb_async_handle *init_ltdb_handle(struct ltdb_private *ltdb, struct ldb_module *module,
void *context,
- int (*callback)(struct ldb_context *, void *, struct ldb_async_result *),
- int timeout)
+ int (*callback)(struct ldb_context *, void *, struct ldb_async_result *))
{
struct ltdb_async_context *ac;
struct ldb_async_handle *h;
ac->module = module;
ac->context = context;
ac->callback = callback;
- ac->timeout = timeout;
return h;
}
static int ltdb_add_async(struct ldb_module *module, const struct ldb_message *msg,
void *context,
int (*callback)(struct ldb_context *, void *, struct ldb_async_result *),
- int timeout,
struct ldb_async_handle **handle)
{
struct ltdb_private *ltdb = talloc_get_type(module->private_data, struct ltdb_private);
struct ltdb_async_context *ltdb_ac;
int ret = LDB_ERR_OPERATIONS_ERROR;
- *handle = init_ltdb_handle(ltdb, module, context, callback, timeout);
+ *handle = init_ltdb_handle(ltdb, module, context, callback);
if (*handle == NULL) {
return ret;
}
struct ldb_async_handle *handle;
int ret;
- ret = ltdb_add_async(module, msg, NULL, NULL, 0, &handle);
+ ret = ltdb_add_async(module, msg, NULL, NULL, &handle);
if (ret != LDB_SUCCESS)
return ret;
static int ltdb_delete_async(struct ldb_module *module, const struct ldb_dn *dn,
void *context,
int (*callback)(struct ldb_context *, void *, struct ldb_async_result *),
- int timeout,
struct ldb_async_handle **handle)
{
struct ltdb_private *ltdb = talloc_get_type(module->private_data, struct ltdb_private);
goto failed;
}
- *handle = init_ltdb_handle(ltdb, module, context, callback, timeout);
+ *handle = init_ltdb_handle(ltdb, module, context, callback);
if (*handle == NULL) {
goto failed;
}
struct ldb_async_handle *handle;
int ret;
- ret = ltdb_delete_async(module, dn,
- NULL, NULL, 0, &handle);
+ ret = ltdb_delete_async(module, dn, NULL, NULL, &handle);
if (ret != LDB_SUCCESS)
return ret;
static int ltdb_modify_async(struct ldb_module *module, const struct ldb_message *msg,
void *context,
int (*callback)(struct ldb_context *, void *, struct ldb_async_result *),
- int timeout,
struct ldb_async_handle **handle)
{
struct ltdb_private *ltdb = talloc_get_type(module->private_data, struct ltdb_private);
*handle = NULL;
- *handle = init_ltdb_handle(ltdb, module, context, callback, timeout);
+ *handle = init_ltdb_handle(ltdb, module, context, callback);
if (*handle == NULL) {
return ret;
}
struct ldb_async_handle *handle;
int ret;
- ret = ltdb_modify_async(module, msg, NULL, NULL, 0, &handle);
+ ret = ltdb_modify_async(module, msg, NULL, NULL, &handle);
if (ret != LDB_SUCCESS)
return ret;
static int ltdb_rename_async(struct ldb_module *module, const struct ldb_dn *olddn, const struct ldb_dn *newdn,
void *context,
int (*callback)(struct ldb_context *, void *, struct ldb_async_result *),
- int timeout,
struct ldb_async_handle **handle)
{
struct ltdb_private *ltdb = talloc_get_type(module->private_data, struct ltdb_private);
return ret;
}
- *handle = init_ltdb_handle(ltdb, module, context, callback, timeout);
+ *handle = init_ltdb_handle(ltdb, module, context, callback);
if (*handle == NULL) {
goto failed;
}
struct ldb_async_handle *handle;
int ret;
- ret = ltdb_rename_async(module, olddn, newdn,
- NULL, NULL, 0, &handle);
+ ret = ltdb_rename_async(module, olddn, newdn, NULL, NULL, &handle);
if (ret != LDB_SUCCESS)
return ret;
req->op.search.attrs,
req->async.context,
req->async.callback,
- req->async.timeout,
&req->async.handle);
case LDB_ASYNC_ADD:
req->op.add.message,
req->async.context,
req->async.callback,
- req->async.timeout,
&req->async.handle);
case LDB_ASYNC_MODIFY:
req->op.mod.message,
req->async.context,
req->async.callback,
- req->async.timeout,
&req->async.handle);
case LDB_ASYNC_DELETE:
req->op.del.dn,
req->async.context,
req->async.callback,
- req->async.timeout,
&req->async.handle);
case LDB_ASYNC_RENAME:
req->op.rename.newdn,
req->async.context,
req->async.callback,
- req->async.timeout,
&req->async.handle);
default:
/* async stuff */
void *context;
- int timeout;
int (*callback)(struct ldb_context *, void *, struct ldb_async_result *);
};
const char * const *attrs,
void *context,
int (*callback)(struct ldb_context *, void *, struct ldb_async_result *),
- int timeout,
struct ldb_async_handle **handle);
int ltdb_search_bytree(struct ldb_module *module, const struct ldb_dn *base,
enum ldb_scope scope, struct ldb_parse_tree *tree,
/* The following definitions come from lib/ldb/ldb_tdb/ldb_tdb.c */
struct ldb_async_handle *init_ltdb_handle(struct ltdb_private *ltdb, struct ldb_module *module,
void *context,
- int (*callback)(struct ldb_context *, void *, struct ldb_async_result *),
- int timeout);
+ int (*callback)(struct ldb_context *, void *, struct ldb_async_result *));
struct TDB_DATA ltdb_key(struct ldb_module *module, const struct ldb_dn *dn);
int ltdb_store(struct ldb_module *module, const struct ldb_message *msg, int flgs);
int ltdb_delete_noindex(struct ldb_module *module, const struct ldb_dn *dn);