summaryrefslogtreecommitdiff
path: root/source4/lib/ldb/common
diff options
context:
space:
mode:
authorSimo Sorce <idra@samba.org>2006-02-22 01:31:35 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:51:59 -0500
commit00fe70e5b917769418f68eaa255d3a06a9a08ce7 (patch)
tree7fe1d0d71e1771a3365a5dfda3ec4058b1bb2de1 /source4/lib/ldb/common
parentf490434c0f1f8e63de478c6d65f264277257968a (diff)
downloadsamba-00fe70e5b917769418f68eaa255d3a06a9a08ce7.tar.gz
samba-00fe70e5b917769418f68eaa255d3a06a9a08ce7.tar.bz2
samba-00fe70e5b917769418f68eaa255d3a06a9a08ce7.zip
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 used to be commit 1e2c13b2d52de7c534493dd79a2c0596a3e8c1f5)
Diffstat (limited to 'source4/lib/ldb/common')
-rw-r--r--source4/lib/ldb/common/ldb.c21
-rw-r--r--source4/lib/ldb/common/ldb_modules.c10
2 files changed, 20 insertions, 11 deletions
diff --git a/source4/lib/ldb/common/ldb.c b/source4/lib/ldb/common/ldb.c
index 0857c07ad4..68722cde96 100644
--- a/source4/lib/ldb/common/ldb.c
+++ b/source4/lib/ldb/common/ldb.c
@@ -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) {
diff --git a/source4/lib/ldb/common/ldb_modules.c b/source4/lib/ldb/common/ldb_modules.c
index ddbdddedcc..922506ea4d 100644
--- a/source4/lib/ldb/common/ldb_modules.c
+++ b/source4/lib/ldb/common/ldb_modules.c
@@ -263,13 +263,3 @@ int ldb_next_del_trans(struct ldb_module *module)
FIND_OP(module, del_transaction);
return module->ops->del_transaction(module);
}
-
-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);
-}
-