summaryrefslogtreecommitdiff
path: root/source4/wrepl_server
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2010-03-03 15:12:05 +0100
committerStefan Metzmacher <metze@samba.org>2010-03-05 14:09:02 +0100
commit50f1dc9db8fbe0da7a6c6d5dde54da08994be318 (patch)
tree23d5c43d35a153c6b9cbcd983bb9c17537d32b23 /source4/wrepl_server
parent1a8815abd32b1a888c4fc202000891233f9437fe (diff)
downloadsamba-50f1dc9db8fbe0da7a6c6d5dde54da08994be318.tar.gz
samba-50f1dc9db8fbe0da7a6c6d5dde54da08994be318.tar.bz2
samba-50f1dc9db8fbe0da7a6c6d5dde54da08994be318.zip
s4:libcli/wrepl: convert wrepl_pull_names_send to tevent_req
metze
Diffstat (limited to 'source4/wrepl_server')
-rw-r--r--source4/wrepl_server/wrepl_out_helpers.c23
1 files changed, 14 insertions, 9 deletions
diff --git a/source4/wrepl_server/wrepl_out_helpers.c b/source4/wrepl_server/wrepl_out_helpers.c
index 7f460c56ef..08d0fa4c30 100644
--- a/source4/wrepl_server/wrepl_out_helpers.c
+++ b/source4/wrepl_server/wrepl_out_helpers.c
@@ -414,14 +414,14 @@ enum wreplsrv_pull_names_stage {
struct wreplsrv_pull_names_state {
enum wreplsrv_pull_names_stage stage;
struct composite_context *c;
- struct wrepl_request *req;
struct wrepl_pull_names pull_io;
struct wreplsrv_pull_names_io *io;
struct composite_context *creq;
struct wreplsrv_out_connection *wreplconn;
+ struct tevent_req *subreq;
};
-static void wreplsrv_pull_names_handler_req(struct wrepl_request *req);
+static void wreplsrv_pull_names_handler_treq(struct tevent_req *subreq);
static NTSTATUS wreplsrv_pull_names_wait_connection(struct wreplsrv_pull_names_state *state)
{
@@ -432,11 +432,15 @@ static NTSTATUS wreplsrv_pull_names_wait_connection(struct wreplsrv_pull_names_s
state->pull_io.in.assoc_ctx = state->wreplconn->assoc_ctx.peer_ctx;
state->pull_io.in.partner = state->io->in.owner;
- state->req = wrepl_pull_names_send(state->wreplconn->sock, &state->pull_io);
- NT_STATUS_HAVE_NO_MEMORY(state->req);
+ state->subreq = wrepl_pull_names_send(state,
+ state->wreplconn->service->task->event_ctx,
+ state->wreplconn->sock,
+ &state->pull_io);
+ NT_STATUS_HAVE_NO_MEMORY(state->subreq);
- state->req->async.fn = wreplsrv_pull_names_handler_req;
- state->req->async.private_data = state;
+ tevent_req_set_callback(state->subreq,
+ wreplsrv_pull_names_handler_treq,
+ state);
state->stage = WREPLSRV_PULL_NAMES_STAGE_WAIT_SEND_REPLY;
@@ -447,7 +451,8 @@ static NTSTATUS wreplsrv_pull_names_wait_send_reply(struct wreplsrv_pull_names_s
{
NTSTATUS status;
- status = wrepl_pull_names_recv(state->req, state, &state->pull_io);
+ status = wrepl_pull_names_recv(state->subreq, state, &state->pull_io);
+ TALLOC_FREE(state->subreq);
NT_STATUS_NOT_OK_RETURN(status);
state->stage = WREPLSRV_PULL_NAMES_STAGE_DONE;
@@ -488,9 +493,9 @@ static void wreplsrv_pull_names_handler_creq(struct composite_context *creq)
return;
}
-static void wreplsrv_pull_names_handler_req(struct wrepl_request *req)
+static void wreplsrv_pull_names_handler_treq(struct tevent_req *subreq)
{
- struct wreplsrv_pull_names_state *state = talloc_get_type(req->async.private_data,
+ struct wreplsrv_pull_names_state *state = tevent_req_callback_data(subreq,
struct wreplsrv_pull_names_state);
wreplsrv_pull_names_handler(state);
return;