mirror of
https://github.com/samba-team/samba.git
synced 2025-12-04 08:23:50 +03:00
r13609: Get in the initial work on making ldb async
Currently only ldb_ildap is async, the plan is to first make all backend support the async calls, and then remove the sync functions from backends and keep the only in the API. Modules will need to be transformed along the way. Simo
This commit is contained in:
committed by
Gerald (Jerry) Carter
parent
d0b8957f38
commit
1e2c13b2d5
@@ -106,7 +106,15 @@ int ldb_connect(struct ldb_context *ldb, const char *url, unsigned int flags, co
|
||||
return LDB_SUCCESS;
|
||||
}
|
||||
|
||||
static void ldb_reset_err_string(struct ldb_context *ldb)
|
||||
void ldb_set_errstring(struct ldb_module *module, char *err_string)
|
||||
{
|
||||
if (module->ldb->err_string) {
|
||||
talloc_free(module->ldb->err_string);
|
||||
}
|
||||
module->ldb->err_string = talloc_steal(module->ldb, err_string);
|
||||
}
|
||||
|
||||
void ldb_reset_err_string(struct ldb_context *ldb)
|
||||
{
|
||||
if (ldb->err_string) {
|
||||
talloc_free(ldb->err_string);
|
||||
@@ -211,6 +219,14 @@ int ldb_transaction_cancel(struct ldb_context *ldb)
|
||||
return status;
|
||||
}
|
||||
|
||||
int ldb_async_wait(struct ldb_context *ldb, struct ldb_async_handle *handle, enum ldb_async_wait_type type)
|
||||
{
|
||||
if (ldb->async_wait != NULL)
|
||||
return ldb->async_wait(handle, type);
|
||||
|
||||
return LDB_ERR_OPERATIONS_ERROR;
|
||||
}
|
||||
|
||||
/*
|
||||
check for an error return from an op
|
||||
if an op fails, but has not setup an error string, then setup one now
|
||||
@@ -279,6 +295,9 @@ int ldb_request(struct ldb_context *ldb, struct ldb_request *request)
|
||||
if (request->operation == LDB_REQ_SEARCH) {
|
||||
request->op.search.res = talloc_steal(ldb, r->op.search.res);
|
||||
}
|
||||
if (request->operation == LDB_ASYNC_SEARCH) {
|
||||
request->async.handle = r->async.handle;
|
||||
}
|
||||
talloc_free(r);
|
||||
|
||||
if (started_transaction) {
|
||||
|
||||
Reference in New Issue
Block a user