From 00fe70e5b917769418f68eaa255d3a06a9a08ce7 Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Wed, 22 Feb 2006 01:31:35 +0000 Subject: 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) --- source4/lib/ldb/tools/cmdline.c | 4 ---- source4/lib/ldb/tools/ldbsearch.c | 12 ++++++++++-- 2 files changed, 10 insertions(+), 6 deletions(-) (limited to 'source4/lib/ldb/tools') diff --git a/source4/lib/ldb/tools/cmdline.c b/source4/lib/ldb/tools/cmdline.c index 24005c450c..a67c41e67f 100644 --- a/source4/lib/ldb/tools/cmdline.c +++ b/source4/lib/ldb/tools/cmdline.c @@ -596,10 +596,6 @@ int handle_controls_reply(struct ldb_control **reply, struct ldb_control **reque cookie = ldb_base64_encode(req_control, rep_control->cookie, rep_control->cookie_len); printf("# DIRSYNC cookie returned was:\n# %s\n", cookie); - sleep(120); - - ret = 1; - continue; } diff --git a/source4/lib/ldb/tools/ldbsearch.c b/source4/lib/ldb/tools/ldbsearch.c index b4120c0dce..c380862c5d 100644 --- a/source4/lib/ldb/tools/ldbsearch.c +++ b/source4/lib/ldb/tools/ldbsearch.c @@ -64,9 +64,10 @@ static int do_search(struct ldb_context *ldb, const char *expression, const char * const *attrs) { - int ret, i; + int ret, i, n; int loop = 0; int total = 0; + int refs = 0; struct ldb_request req; struct ldb_result *result = NULL; @@ -94,7 +95,6 @@ static int do_search(struct ldb_context *ldb, } result = req.op.search.res; - printf("# returned %d records\n", result->count); if (options->sorted) { ldb_qsort(result->msgs, result->count, sizeof(struct ldb_message *), @@ -120,6 +120,12 @@ static int do_search(struct ldb_context *ldb, ldb_ldif_write_file(ldb, stdout, &ldif); } + if (result->refs) { + for(n = 0;result->refs[n]; n++, refs++) { + printf("# referral %d\nref: %s\n\n", refs + 1, result->refs[n]); + } + } + if (result->controls) { if (handle_controls_reply(result->controls, req.controls) == 1) loop = 1; @@ -137,6 +143,8 @@ static int do_search(struct ldb_context *ldb, } while(loop); + printf("# returned %d records\n# %d entries\n# %d referrals\n", total + refs, total, refs); + return 0; } -- cgit