summaryrefslogtreecommitdiff
path: root/source4/wrepl_server
diff options
context:
space:
mode:
Diffstat (limited to 'source4/wrepl_server')
-rw-r--r--source4/wrepl_server/wrepl_out_helpers.c22
1 files changed, 13 insertions, 9 deletions
diff --git a/source4/wrepl_server/wrepl_out_helpers.c b/source4/wrepl_server/wrepl_out_helpers.c
index 08d0fa4c30..9745761436 100644
--- a/source4/wrepl_server/wrepl_out_helpers.c
+++ b/source4/wrepl_server/wrepl_out_helpers.c
@@ -255,14 +255,14 @@ enum wreplsrv_pull_table_stage {
struct wreplsrv_pull_table_state {
enum wreplsrv_pull_table_stage stage;
struct composite_context *c;
- struct wrepl_request *req;
struct wrepl_pull_table table_io;
struct wreplsrv_pull_table_io *io;
struct composite_context *creq;
struct wreplsrv_out_connection *wreplconn;
+ struct tevent_req *subreq;
};
-static void wreplsrv_pull_table_handler_req(struct wrepl_request *req);
+static void wreplsrv_pull_table_handler_treq(struct tevent_req *subreq);
static NTSTATUS wreplsrv_pull_table_wait_connection(struct wreplsrv_pull_table_state *state)
{
@@ -272,11 +272,14 @@ static NTSTATUS wreplsrv_pull_table_wait_connection(struct wreplsrv_pull_table_s
NT_STATUS_NOT_OK_RETURN(status);
state->table_io.in.assoc_ctx = state->wreplconn->assoc_ctx.peer_ctx;
- state->req = wrepl_pull_table_send(state->wreplconn->sock, &state->table_io);
- NT_STATUS_HAVE_NO_MEMORY(state->req);
+ state->subreq = wrepl_pull_table_send(state,
+ state->wreplconn->service->task->event_ctx,
+ state->wreplconn->sock, &state->table_io);
+ NT_STATUS_HAVE_NO_MEMORY(state->subreq);
- state->req->async.fn = wreplsrv_pull_table_handler_req;
- state->req->async.private_data = state;
+ tevent_req_set_callback(state->subreq,
+ wreplsrv_pull_table_handler_treq,
+ state);
state->stage = WREPLSRV_PULL_TABLE_STAGE_WAIT_TABLE_REPLY;
@@ -287,7 +290,8 @@ static NTSTATUS wreplsrv_pull_table_wait_table_reply(struct wreplsrv_pull_table_
{
NTSTATUS status;
- status = wrepl_pull_table_recv(state->req, state, &state->table_io);
+ status = wrepl_pull_table_recv(state->subreq, state, &state->table_io);
+ TALLOC_FREE(state->subreq);
NT_STATUS_NOT_OK_RETURN(status);
state->stage = WREPLSRV_PULL_TABLE_STAGE_DONE;
@@ -328,9 +332,9 @@ static void wreplsrv_pull_table_handler_creq(struct composite_context *creq)
return;
}
-static void wreplsrv_pull_table_handler_req(struct wrepl_request *req)
+static void wreplsrv_pull_table_handler_treq(struct tevent_req *subreq)
{
- struct wreplsrv_pull_table_state *state = talloc_get_type(req->async.private_data,
+ struct wreplsrv_pull_table_state *state = tevent_req_callback_data(subreq,
struct wreplsrv_pull_table_state);
wreplsrv_pull_table_handler(state);
return;