Author: idra Date: 2006-03-10 15:50:47 +0000 (Fri, 10 Mar 2006) New Revision: 14163
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=14163 Log: Remove LDB_WAIT_ONCE, we can hardly guarante we 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. Modified: branches/SAMBA_4_0/source/lib/ldb/include/ldb.h branches/SAMBA_4_0/source/lib/ldb/ldb_ildap/ldb_ildap.c branches/SAMBA_4_0/source/lib/ldb/ldb_ldap/ldb_ldap.c Changeset: Modified: branches/SAMBA_4_0/source/lib/ldb/include/ldb.h =================================================================== --- branches/SAMBA_4_0/source/lib/ldb/include/ldb.h 2006-03-10 15:28:25 UTC (rev 14162) +++ branches/SAMBA_4_0/source/lib/ldb/include/ldb.h 2006-03-10 15:50:47 UTC (rev 14163) @@ -577,7 +577,6 @@ enum ldb_async_wait_type { LDB_WAIT_ALL, - LDB_WAIT_ONCE, LDB_WAIT_NONE }; Modified: branches/SAMBA_4_0/source/lib/ldb/ldb_ildap/ldb_ildap.c =================================================================== --- branches/SAMBA_4_0/source/lib/ldb/ldb_ildap/ldb_ildap.c 2006-03-10 15:28:25 UTC (rev 14162) +++ branches/SAMBA_4_0/source/lib/ldb/ldb_ildap/ldb_ildap.c 2006-03-10 15:50:47 UTC (rev 14163) @@ -941,13 +941,6 @@ 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) { Modified: branches/SAMBA_4_0/source/lib/ldb/ldb_ldap/ldb_ldap.c =================================================================== --- branches/SAMBA_4_0/source/lib/ldb/ldb_ldap/ldb_ldap.c 2006-03-10 15:28:25 UTC (rev 14162) +++ branches/SAMBA_4_0/source/lib/ldb/ldb_ldap/ldb_ldap.c 2006-03-10 15:50:47 UTC (rev 14163) @@ -913,16 +913,6 @@ } 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;