summaryrefslogtreecommitdiff
path: root/source4/lib/ldb/modules/paged_results.c
diff options
context:
space:
mode:
authorSimo Sorce <idra@samba.org>2006-03-13 21:05:55 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:57:13 -0500
commitb1bf44a4e1190fe41440e731adaab9db14881508 (patch)
tree00c15d4ce28d2f7d509d5c55af03c212e0eff42f /source4/lib/ldb/modules/paged_results.c
parentb67cf4ce262c834015ffda7bbbc1c62711f097aa (diff)
downloadsamba-b1bf44a4e1190fe41440e731adaab9db14881508.tar.gz
samba-b1bf44a4e1190fe41440e731adaab9db14881508.tar.bz2
samba-b1bf44a4e1190fe41440e731adaab9db14881508.zip
r14344: More helpful messages on error for command line specified controls
fixes in paged_results asq -> async (This used to be commit fbd347544001da9e46246eb0b4a8d165ccab15c9)
Diffstat (limited to 'source4/lib/ldb/modules/paged_results.c')
-rw-r--r--source4/lib/ldb/modules/paged_results.c94
1 files changed, 47 insertions, 47 deletions
diff --git a/source4/lib/ldb/modules/paged_results.c b/source4/lib/ldb/modules/paged_results.c
index 58b066bd14..5ce062868e 100644
--- a/source4/lib/ldb/modules/paged_results.c
+++ b/source4/lib/ldb/modules/paged_results.c
@@ -71,53 +71,6 @@ struct private_data {
};
-struct paged_async_context {
- struct ldb_module *module;
- void *up_context;
- int (*up_callback)(struct ldb_context *, void *, struct ldb_async_result *);
- int timeout;
-
- int size;
-
- struct results_store *store;
-};
-
-static struct ldb_async_handle *init_handle(void *mem_ctx, struct ldb_module *module,
- void *context,
- int (*callback)(struct ldb_context *, void *, struct ldb_async_result *),
- int timeout)
-{
- struct paged_async_context *ac;
- struct ldb_async_handle *h;
-
- h = talloc_zero(mem_ctx, struct ldb_async_handle);
- if (h == NULL) {
- ldb_set_errstring(module->ldb, talloc_asprintf(module, "Out of Memory"));
- return NULL;
- }
-
- h->module = module;
-
- ac = talloc_zero(h, struct paged_async_context);
- if (ac == NULL) {
- ldb_set_errstring(module->ldb, talloc_asprintf(module, "Out of Memory"));
- talloc_free(h);
- return NULL;
- }
-
- h->private_data = (void *)ac;
-
- h->state = LDB_ASYNC_INIT;
- h->status = LDB_SUCCESS;
-
- ac->module = module;
- ac->up_context = context;
- ac->up_callback = callback;
- ac->timeout = timeout;
-
- return h;
-}
-
int store_destructor(void *data)
{
struct results_store *store = talloc_get_type(data, struct results_store);
@@ -300,6 +253,53 @@ static int paged_search(struct ldb_module *module, struct ldb_control *control,
return LDB_SUCCESS;
}
+struct paged_async_context {
+ struct ldb_module *module;
+ void *up_context;
+ int (*up_callback)(struct ldb_context *, void *, struct ldb_async_result *);
+ int timeout;
+
+ int size;
+
+ struct results_store *store;
+};
+
+static struct ldb_async_handle *init_handle(void *mem_ctx, struct ldb_module *module,
+ void *context,
+ int (*callback)(struct ldb_context *, void *, struct ldb_async_result *),
+ int timeout)
+{
+ struct paged_async_context *ac;
+ struct ldb_async_handle *h;
+
+ h = talloc_zero(mem_ctx, struct ldb_async_handle);
+ if (h == NULL) {
+ ldb_set_errstring(module->ldb, talloc_asprintf(module, "Out of Memory"));
+ return NULL;
+ }
+
+ h->module = module;
+
+ ac = talloc_zero(h, struct paged_async_context);
+ if (ac == NULL) {
+ ldb_set_errstring(module->ldb, talloc_asprintf(module, "Out of Memory"));
+ talloc_free(h);
+ return NULL;
+ }
+
+ h->private_data = (void *)ac;
+
+ h->state = LDB_ASYNC_INIT;
+ h->status = LDB_SUCCESS;
+
+ ac->module = module;
+ ac->up_context = context;
+ ac->up_callback = callback;
+ ac->timeout = timeout;
+
+ return h;
+}
+
static int paged_search_async_callback(struct ldb_context *ldb, void *context, struct ldb_async_result *ares)
{
struct paged_async_context *ac = NULL;