summaryrefslogtreecommitdiff
path: root/source4/lib/ldb/ldb_ildap
diff options
context:
space:
mode:
authorSimo Sorce <idra@samba.org>2006-03-10 15:27:16 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:56:56 -0500
commit3baf0606040419988f1a08c0da7f546c5904d8ca (patch)
treeb0a0ea4edce4523b965690f23240d6a284d984f6 /source4/lib/ldb/ldb_ildap
parent3d9fc634ef8164a34adf14c0f77473c6268d2538 (diff)
downloadsamba-3baf0606040419988f1a08c0da7f546c5904d8ca.tar.gz
samba-3baf0606040419988f1a08c0da7f546c5904d8ca.tar.bz2
samba-3baf0606040419988f1a08c0da7f546c5904d8ca.zip
r14161: return early if we know the job is already finished
(This used to be commit 09f6f552d73f782dc8d62cefad9c5f584b7b07d2)
Diffstat (limited to 'source4/lib/ldb/ldb_ildap')
-rw-r--r--source4/lib/ldb/ldb_ildap/ldb_ildap.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/source4/lib/ldb/ldb_ildap/ldb_ildap.c b/source4/lib/ldb/ldb_ildap/ldb_ildap.c
index f309262a55..ceb9c4aafb 100644
--- a/source4/lib/ldb/ldb_ildap/ldb_ildap.c
+++ b/source4/lib/ldb/ldb_ildap/ldb_ildap.c
@@ -352,6 +352,9 @@ static int ildb_request_send(struct ldb_module *module, struct ldap_message *msg
h->private_data = (void *)ildb_ac;
+ h->state = LDB_ASYNC_INIT;
+ h->status = LDB_SUCCESS;
+
req = ldap_request_send(ildb->ldap, msg);
if (req == NULL) {
ldb_set_errstring(module->ldb, talloc_asprintf(module, "async send request failed"));
@@ -922,6 +925,10 @@ static int ildb_async_wait(struct ldb_async_handle *handle, enum ldb_async_wait_
{
struct ildb_async_context *ac = talloc_get_type(handle->private_data, struct ildb_async_context);
+ if (handle->state == LDB_ASYNC_DONE) {
+ return handle->status;
+ }
+
if (!ac) {
return LDB_ERR_OPERATIONS_ERROR;
}