diff options
author | Simo Sorce <idra@samba.org> | 2006-07-22 16:56:33 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 14:10:16 -0500 |
commit | c93817b36d3ff7f44cb7b3e1d1a29e37ec12affe (patch) | |
tree | 70d3018287cbbe9ceee3cae3ab66ce33f32559aa /source4/lib/ldb/ldb_ildap/ldb_ildap.c | |
parent | 550f5fb26e67f46eead182476f7a9bcfd1ac5dc0 (diff) | |
download | samba-c93817b36d3ff7f44cb7b3e1d1a29e37ec12affe.tar.gz samba-c93817b36d3ff7f44cb7b3e1d1a29e37ec12affe.tar.bz2 samba-c93817b36d3ff7f44cb7b3e1d1a29e37ec12affe.zip |
r17185: Oh, I wanted to do this for sooo long time.
Finally acknowledge that ldb is inherently async and does not have a dual personality anymore
Rename all ldb_async_XXX functions to ldb_XXX except for ldb_async_result, it is now ldb_reply
to reflect the real function of this structure.
Simo.
(This used to be commit 25fc7354049d62efeba17681ef1cdd326bc3f2ef)
Diffstat (limited to 'source4/lib/ldb/ldb_ildap/ldb_ildap.c')
-rw-r--r-- | source4/lib/ldb/ldb_ildap/ldb_ildap.c | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/source4/lib/ldb/ldb_ildap/ldb_ildap.c b/source4/lib/ldb/ldb_ildap/ldb_ildap.c index 9251451549..3410d68c5e 100644 --- a/source4/lib/ldb/ldb_ildap/ldb_ildap.c +++ b/source4/lib/ldb/ldb_ildap/ldb_ildap.c @@ -56,11 +56,11 @@ struct ildb_private { struct ldb_context *ldb; }; -struct ildb_async_context { +struct ildb_context { struct ldb_module *module; struct ldap_request *req; void *context; - int (*callback)(struct ldb_context *, void *, struct ldb_async_result *); + int (*callback)(struct ldb_context *, void *, struct ldb_reply *); }; /* @@ -136,8 +136,8 @@ static int ildb_map_error(struct ildb_private *ildb, NTSTATUS status) static void ildb_request_timeout(struct event_context *ev, struct timed_event *te, struct timeval t, void *private_data) { - struct ldb_async_handle *handle = talloc_get_type(private_data, struct ldb_async_handle); - struct ildb_async_context *ac = talloc_get_type(handle->private_data, struct ildb_async_context); + struct ldb_handle *handle = talloc_get_type(private_data, struct ldb_handle); + struct ildb_context *ac = talloc_get_type(handle->private_data, struct ildb_context); if (ac->req->state == LDAP_REQUEST_PENDING) { DLIST_REMOVE(ac->req->conn->pending, ac->req); @@ -150,8 +150,8 @@ static void ildb_request_timeout(struct event_context *ev, struct timed_event *t static void ildb_callback(struct ldap_request *req) { - struct ldb_async_handle *handle = talloc_get_type(req->async.private_data, struct ldb_async_handle); - struct ildb_async_context *ac = talloc_get_type(handle->private_data, struct ildb_async_context); + struct ldb_handle *handle = talloc_get_type(req->async.private_data, struct ldb_handle); + struct ildb_context *ac = talloc_get_type(handle->private_data, struct ildb_context); struct ildb_private *ildb = talloc_get_type(ac->module->private_data, struct ildb_private); NTSTATUS status; int i; @@ -230,11 +230,11 @@ static void ildb_callback(struct ldap_request *req) /* loop over all messages */ for (i = 0; i < req->num_replies; i++) { struct ldap_SearchResEntry *search; - struct ldb_async_result *ares = NULL; + struct ldb_reply *ares = NULL; struct ldap_message *msg; int ret; - ares = talloc_zero(ac, struct ldb_async_result); + ares = talloc_zero(ac, struct ldb_reply); if (!ares) { handle->status = LDB_ERR_OPERATIONS_ERROR; return; @@ -325,16 +325,16 @@ static void ildb_callback(struct ldap_request *req) static int ildb_request_send(struct ldb_module *module, struct ldap_message *msg, void *context, - int (*callback)(struct ldb_context *, void *, struct ldb_async_result *), + int (*callback)(struct ldb_context *, void *, struct ldb_reply *), int timeout, - struct ldb_async_handle **handle) + struct ldb_handle **handle) { struct ildb_private *ildb = talloc_get_type(module->private_data, struct ildb_private); - struct ildb_async_context *ildb_ac; - struct ldb_async_handle *h; + struct ildb_context *ildb_ac; + struct ldb_handle *h; struct ldap_request *req; - h = talloc_zero(ildb->ldap, struct ldb_async_handle); + h = talloc_zero(ildb->ldap, struct ldb_handle); if (h == NULL) { ldb_set_errstring(module->ldb, talloc_asprintf(module, "Out of Memory")); return LDB_ERR_OPERATIONS_ERROR; @@ -342,7 +342,7 @@ static int ildb_request_send(struct ldb_module *module, struct ldap_message *msg h->module = module; - ildb_ac = talloc(h, struct ildb_async_context); + ildb_ac = talloc(h, struct ildb_context); if (ildb_ac == NULL) { ldb_set_errstring(module->ldb, talloc_asprintf(module, "Out of Memory")); talloc_free(h); @@ -665,9 +665,9 @@ static int ildb_request(struct ldb_module *module, struct ldb_request *req) return LDB_ERR_OPERATIONS_ERROR; } -static int ildb_async_wait(struct ldb_async_handle *handle, enum ldb_async_wait_type type) +static int ildb_wait(struct ldb_handle *handle, enum ldb_wait_type type) { - struct ildb_async_context *ac = talloc_get_type(handle->private_data, struct ildb_async_context); + struct ildb_context *ac = talloc_get_type(handle->private_data, struct ildb_context); if (handle->state == LDB_ASYNC_DONE) { return handle->status; @@ -699,7 +699,7 @@ static int ildb_async_wait(struct ldb_async_handle *handle, enum ldb_async_wait_ return handle->status; } -static int ildb_rootdse_callback(struct ldb_context *ldb, void *context, struct ldb_async_result *ares) +static int ildb_rootdse_callback(struct ldb_context *ldb, void *context, struct ldb_reply *ares) { struct ildb_private *ildb; @@ -767,7 +767,7 @@ static int ildb_init(struct ldb_module *module) return ret; } - ret = ildb_async_wait(req->async.handle, LDB_WAIT_ALL); + ret = ildb_wait(req->async.handle, LDB_WAIT_ALL); talloc_free(req); return ret; @@ -784,7 +784,7 @@ static const struct ldb_module_ops ildb_ops = { .start_transaction = ildb_start_trans, .end_transaction = ildb_end_trans, .del_transaction = ildb_del_trans, - .async_wait = ildb_async_wait, + .wait = ildb_wait, .init_context = ildb_init }; |