diff options
author | Stefan Metzmacher <metze@samba.org> | 2010-03-03 15:14:28 +0100 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2010-03-05 14:09:02 +0100 |
commit | 2e24def8063f15f6d29fae667e7d1c50b90d1cd5 (patch) | |
tree | fcc7ffa7e238d7d18124b0457add508666d044e9 /source4/wrepl_server | |
parent | 50f1dc9db8fbe0da7a6c6d5dde54da08994be318 (diff) | |
download | samba-2e24def8063f15f6d29fae667e7d1c50b90d1cd5.tar.gz samba-2e24def8063f15f6d29fae667e7d1c50b90d1cd5.tar.bz2 samba-2e24def8063f15f6d29fae667e7d1c50b90d1cd5.zip |
s4:libcli/wrepl: convert wrepl_pull_table_send to tevent_req
metze
Diffstat (limited to 'source4/wrepl_server')
-rw-r--r-- | source4/wrepl_server/wrepl_out_helpers.c | 22 |
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; |