diff options
author | Stefan Metzmacher <metze@samba.org> | 2011-10-10 15:46:17 +0200 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2011-10-10 21:50:26 +0200 |
commit | 5a7a1b35be01b7461549a2202ccabd3608b054a1 (patch) | |
tree | f45d232ce0c7004d96ed540f126220c6796e2b04 | |
parent | 2cd76b0931582463a6e72df227f3e100dfb00f84 (diff) | |
download | samba-5a7a1b35be01b7461549a2202ccabd3608b054a1.tar.gz samba-5a7a1b35be01b7461549a2202ccabd3608b054a1.tar.bz2 samba-5a7a1b35be01b7461549a2202ccabd3608b054a1.zip |
libcli/cldap: pass tevent_context to cldap_search_send()
metze
-rw-r--r-- | libcli/cldap/cldap.c | 11 | ||||
-rw-r--r-- | libcli/cldap/cldap.h | 1 | ||||
-rw-r--r-- | source4/torture/ldap/cldapbench.c | 2 |
3 files changed, 9 insertions, 5 deletions
diff --git a/libcli/cldap/cldap.c b/libcli/cldap/cldap.c index c73d37466c..9253629ba5 100644 --- a/libcli/cldap/cldap.c +++ b/libcli/cldap/cldap.c @@ -98,6 +98,7 @@ struct cldap_search_state { struct cldap_search_state *prev, *next; struct { + struct tevent_context *ev; struct cldap_socket *cldap; } caller; @@ -535,8 +536,9 @@ static void cldap_search_state_wakeup_done(struct tevent_req *subreq); queue a cldap reply for send */ struct tevent_req *cldap_search_send(TALLOC_CTX *mem_ctx, - struct cldap_socket *cldap, - const struct cldap_search *io) + struct tevent_context *ev, + struct cldap_socket *cldap, + const struct cldap_search *io) { struct tevent_req *req, *subreq; struct cldap_search_state *state = NULL; @@ -553,6 +555,7 @@ struct tevent_req *cldap_search_send(TALLOC_CTX *mem_ctx, return NULL; } ZERO_STRUCTP(state); + state->caller.ev = ev; state->req = req; state->caller.cldap = cldap; state->message_id = -1; @@ -818,7 +821,7 @@ NTSTATUS cldap_search(struct cldap_socket *cldap, return NT_STATUS_PIPE_BUSY; } - req = cldap_search_send(mem_ctx, cldap, io); + req = cldap_search_send(mem_ctx, cldap->event.ctx, cldap, io); NT_STATUS_HAVE_NO_MEMORY(req); if (!tevent_req_poll(req, cldap->event.ctx)) { @@ -931,7 +934,7 @@ struct tevent_req *cldap_netlogon_send(TALLOC_CTX *mem_ctx, state->search.in.timeout = 2; state->search.in.retries = 2; - subreq = cldap_search_send(state, cldap, &state->search); + subreq = cldap_search_send(state, ev, cldap, &state->search); if (tevent_req_nomem(subreq, req)) { goto post; } diff --git a/libcli/cldap/cldap.h b/libcli/cldap/cldap.h index bf259e9aa5..10c92959e0 100644 --- a/libcli/cldap/cldap.h +++ b/libcli/cldap/cldap.h @@ -64,6 +64,7 @@ NTSTATUS cldap_set_incoming_handler(struct cldap_socket *cldap, struct cldap_incoming *), void *private_data); struct tevent_req *cldap_search_send(TALLOC_CTX *mem_ctx, + struct tevent_context *ev, struct cldap_socket *cldap, const struct cldap_search *io); NTSTATUS cldap_search_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx, diff --git a/source4/torture/ldap/cldapbench.c b/source4/torture/ldap/cldapbench.c index 118881d034..9b87ae3138 100644 --- a/source4/torture/ldap/cldapbench.c +++ b/source4/torture/ldap/cldapbench.c @@ -172,7 +172,7 @@ static bool bench_cldap_rootdse(struct torture_context *tctx, const char *addres while (timeval_elapsed(&tv) < timelimit) { while (num_sent - (state->pass_count+state->fail_count) < 10) { struct tevent_req *req; - req = cldap_search_send(state, cldap, &search); + req = cldap_search_send(state, tctx->ev, cldap, &search); tevent_req_set_callback(req, request_rootdse_handler, state); |