ac->up_context = context;
ac->up_callback = callback;
- ac->pending = False;
+ ac->pending = false;
+
+
+
ac->saved_referrals = NULL;
ac->num_referrals = 0;
rep_control = talloc_get_type(ares->controls[0]->data, struct ldb_paged_control);
if (rep_control->cookie_len == 0) {
/* we are done */
- ac->pending = False;
+ ac->pending = false;
return LDB_SUCCESS;
}
rep_control->cookie_len);
req_control->cookie_len = rep_control->cookie_len;
- ac->pending = True;
+ ac->pending = true;
return LDB_SUCCESS;
}
return ldb_next_request(handle->module, ac->new_req);
}
-static int ps_wait_none(struct ldb_handle *handle)
+static int ps_wait_once(struct ldb_handle *handle)
{
struct ps_context *ac;
int ret;
return ret;
}
-static int ps_wait_all(struct ldb_handle *handle)
+static int ps_wait(struct ldb_handle *handle, enum ldb_wait_type type)
{
int ret;
- while (handle->state != LDB_ASYNC_DONE) {
- ret = ps_wait_none(handle);
- if (ret != LDB_SUCCESS) {
- return ret;
- }
+ if (!handle || !handle->private_data) {
+ return LDB_ERR_OPERATIONS_ERROR;
}
- return handle->status;
-}
-
-static int ps_wait(struct ldb_handle *handle, enum ldb_wait_type type)
-{
if (type == LDB_WAIT_ALL) {
- return ps_wait_all(handle);
- } else {
- return ps_wait_none(handle);
+ while (handle->state != LDB_ASYNC_DONE) {
+ ret = ps_wait_once(handle);
+ if (ret != LDB_SUCCESS) {
+ return ret;
+ }
+ }
+
+ return handle->status;
}
+ return ps_wait_once(handle);
}
static int check_supported_paged(struct ldb_context *ldb, void *context,
if (ldb_msg_check_string_attribute(ares->message,
"supportedControl",
LDB_CONTROL_PAGED_RESULTS_OID)) {
- data->paged_supported = True;
+ data->paged_supported = true;
}
}
return LDB_SUCCESS;
return LDB_ERR_OTHER;
}
module->private_data = data;
- data->paged_supported = False;
+ data->paged_supported = false;
req = talloc(module, struct ldb_request);
if (req == NULL) {
return ldb_next_init(module);
}
-static const struct ldb_module_ops ps_ops = {
+_PUBLIC_ const struct ldb_module_ops ldb_paged_searches_module_ops = {
.name = "paged_searches",
.search = ps_search,
.wait = ps_wait,
.init_context = ps_init
};
-
-int ldb_paged_searches_init(void)
-{
- return ldb_register_module(&ps_ops);
-}
-