r14163: Remove LDB_WAIT_ONCE, we can hardly guarante we
authorSimo Sorce <idra@samba.org>
Fri, 10 Mar 2006 15:50:47 +0000 (15:50 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 18:56:56 +0000 (13:56 -0500)
get anything if not waiting for all, keeping this
value may just lead to false expectations.

You either make blocking call waiting for ALL results
transforming this in a sync call, or either you loop
expecting from 0 to all results being returned at any
time on any of these loops.

It should be clear also that when you may receive results
at any time as soon as you call ldb_request.
Your callback may have received all results even before
calling ldb_async_wait the first time.

Simo.
(This used to be commit 6f041068b50caf919cd971812bdb8e3e810565fb)

source4/lib/ldb/include/ldb.h
source4/lib/ldb/ldb_ildap/ldb_ildap.c
source4/lib/ldb/ldb_ldap/ldb_ldap.c

index dbe929246b1b18a87d28d387b3dbd0a8b2028d31..6abce5d9b91b642ffc59492fad5d7d09bad83020 100644 (file)
@@ -577,7 +577,6 @@ enum ldb_reply_type {
 
 enum ldb_async_wait_type {
        LDB_WAIT_ALL,
-       LDB_WAIT_ONCE,
        LDB_WAIT_NONE
 };
 
index ceb9c4aafb9017fa65d8f7398172436bab8996d5..de07fa9a95234aa373807ff6566040359e212bdd 100644 (file)
@@ -941,13 +941,6 @@ static int ildb_async_wait(struct ldb_async_handle *handle, enum ldb_async_wait_
                        return LDB_ERR_OTHER;
                }
                break;
-       case LDB_WAIT_ONCE:
-               while (handle->status == LDB_SUCCESS && handle->state == LDB_ASYNC_INIT) {
-                      if (event_loop_once(ac->req->conn->event.event_ctx) != 0) {
-                               return LDB_ERR_OTHER;
-                       }
-               }
-               break;
        case LDB_WAIT_ALL:
                while (handle->status == LDB_SUCCESS && handle->state != LDB_ASYNC_DONE) {
                        if (event_loop_once(ac->req->conn->event.event_ctx) != 0) {
index a2ca7a7cc8cceedce2bf264d2490cc630ce24b39..49de229a1e1a9aceeb087bc0b716eacc1bc1c657 100644 (file)
@@ -913,16 +913,6 @@ static int lldb_async_wait(struct ldb_async_handle *handle, enum ldb_async_wait_
                }
                ret = lldb_parse_result(handle, result);
                break;
-       case LDB_WAIT_ONCE:
-               timeout.tv_sec = ac->timeout;
-               timeout.tv_usec = 0;
-               ret = ldap_result(lldb->ldap, ac->msgid, 0, &timeout, &result);
-               if (ret == -1 || ret == 0) {
-                       handle->status = LDB_ERR_OPERATIONS_ERROR;
-                       return handle->status;
-               }
-               ret = lldb_parse_result(handle, result);
-               break;
        case LDB_WAIT_ALL:
                timeout.tv_sec = ac->timeout;
                timeout.tv_usec = 0;