summaryrefslogtreecommitdiff
path: root/source3/lib/tldap.c
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2009-06-27 20:03:55 +0200
committerVolker Lendecke <vl@samba.org>2009-06-27 23:17:49 +0200
commit8e22e38c9c4a08f9f49f3f8f29dab8d6a948948e (patch)
tree45ce82b2e9a17b29318b9e4447c6a5eac9a9893c /source3/lib/tldap.c
parentf5321ffea8fd9e3b4cbf236883664832a0425075 (diff)
downloadsamba-8e22e38c9c4a08f9f49f3f8f29dab8d6a948948e.tar.gz
samba-8e22e38c9c4a08f9f49f3f8f29dab8d6a948948e.tar.bz2
samba-8e22e38c9c4a08f9f49f3f8f29dab8d6a948948e.zip
Move read_ldap_done after read_ldap_send
Diffstat (limited to 'source3/lib/tldap.c')
-rw-r--r--source3/lib/tldap.c49
1 files changed, 25 insertions, 24 deletions
diff --git a/source3/lib/tldap.c b/source3/lib/tldap.c
index 8f6e3a246e..aba8a25fbf 100644
--- a/source3/lib/tldap.c
+++ b/source3/lib/tldap.c
@@ -229,6 +229,31 @@ struct read_ldap_state {
bool done;
};
+static ssize_t read_ldap_more(uint8_t *buf, size_t buflen, void *private_data);
+static void read_ldap_done(struct tevent_req *subreq);
+
+static struct tevent_req *read_ldap_send(TALLOC_CTX *mem_ctx,
+ struct tevent_context *ev,
+ struct tstream_context *conn)
+{
+ struct tevent_req *req, *subreq;
+ struct read_ldap_state *state;
+
+ req = tevent_req_create(mem_ctx, &state, struct read_ldap_state);
+ if (req == NULL) {
+ return NULL;
+ }
+ state->done = false;
+
+ subreq = tstream_read_packet_send(state, ev, conn, 2, read_ldap_more,
+ state);
+ if (tevent_req_nomem(subreq, req)) {
+ return tevent_req_post(req, ev);
+ }
+ tevent_req_set_callback(subreq, read_ldap_done, req);
+ return req;
+}
+
static ssize_t read_ldap_more(uint8_t *buf, size_t buflen, void *private_data)
{
struct read_ldap_state *state = talloc_get_type_abort(
@@ -275,30 +300,6 @@ static ssize_t read_ldap_more(uint8_t *buf, size_t buflen, void *private_data)
return len;
}
-static void read_ldap_done(struct tevent_req *subreq);
-
-static struct tevent_req *read_ldap_send(TALLOC_CTX *mem_ctx,
- struct tevent_context *ev,
- struct tstream_context *conn)
-{
- struct tevent_req *req, *subreq;
- struct read_ldap_state *state;
-
- req = tevent_req_create(mem_ctx, &state, struct read_ldap_state);
- if (req == NULL) {
- return NULL;
- }
- state->done = false;
-
- subreq = tstream_read_packet_send(state, ev, conn, 2, read_ldap_more,
- state);
- if (tevent_req_nomem(subreq, req)) {
- return tevent_req_post(req, ev);
- }
- tevent_req_set_callback(subreq, read_ldap_done, req);
- return req;
-}
-
static void read_ldap_done(struct tevent_req *subreq)
{
struct tevent_req *req = tevent_req_callback_data(