diff options
Diffstat (limited to 'source4/wrepl_server/wrepl_out_helpers.c')
-rw-r--r-- | source4/wrepl_server/wrepl_out_helpers.c | 23 |
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; |