summaryrefslogtreecommitdiff
path: root/source4/wrepl_server
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2010-03-03 17:18:23 +0100
committerStefan Metzmacher <metze@samba.org>2010-03-05 14:09:03 +0100
commit28033bf635f0925f24e5f5f580e8ff8830338441 (patch)
tree1a068adc7a39d81074dd477432116d150b9af62e /source4/wrepl_server
parent883b10983ba3d1c4d0f692b9c661316d8027a83b (diff)
downloadsamba-28033bf635f0925f24e5f5f580e8ff8830338441.tar.gz
samba-28033bf635f0925f24e5f5f580e8ff8830338441.tar.bz2
samba-28033bf635f0925f24e5f5f580e8ff8830338441.zip
s4:libcli/wrepl: convert wrepl_connect_send to tevent_req
metze
Diffstat (limited to 'source4/wrepl_server')
-rw-r--r--source4/wrepl_server/wrepl_out_helpers.c24
1 files changed, 9 insertions, 15 deletions
diff --git a/source4/wrepl_server/wrepl_out_helpers.c b/source4/wrepl_server/wrepl_out_helpers.c
index 352be8503d..9a299c2818 100644
--- a/source4/wrepl_server/wrepl_out_helpers.c
+++ b/source4/wrepl_server/wrepl_out_helpers.c
@@ -41,21 +41,20 @@ enum wreplsrv_out_connect_stage {
struct wreplsrv_out_connect_state {
enum wreplsrv_out_connect_stage stage;
struct composite_context *c;
- struct composite_context *c_req;
struct wrepl_associate assoc_io;
enum winsrepl_partner_type type;
struct wreplsrv_out_connection *wreplconn;
struct tevent_req *subreq;
};
-static void wreplsrv_out_connect_handler_creq(struct composite_context *c_req);
static void wreplsrv_out_connect_handler_treq(struct tevent_req *subreq);
static NTSTATUS wreplsrv_out_connect_wait_socket(struct wreplsrv_out_connect_state *state)
{
NTSTATUS status;
- status = wrepl_connect_recv(state->c_req);
+ status = wrepl_connect_recv(state->subreq);
+ TALLOC_FREE(state->subreq);
NT_STATUS_NOT_OK_RETURN(status);
state->subreq = wrepl_associate_send(state,
@@ -125,14 +124,6 @@ static void wreplsrv_out_connect_handler(struct wreplsrv_out_connect_state *stat
}
}
-static void wreplsrv_out_connect_handler_creq(struct composite_context *creq)
-{
- struct wreplsrv_out_connect_state *state = talloc_get_type(creq->async.private_data,
- struct wreplsrv_out_connect_state);
- wreplsrv_out_connect_handler(state);
- return;
-}
-
static void wreplsrv_out_connect_handler_treq(struct tevent_req *subreq)
{
struct wreplsrv_out_connect_state *state = tevent_req_callback_data(subreq,
@@ -201,13 +192,16 @@ static struct composite_context *wreplsrv_out_connect_send(struct wreplsrv_partn
state->stage = WREPLSRV_OUT_CONNECT_STAGE_WAIT_SOCKET;
state->wreplconn= wreplconn;
- state->c_req = wrepl_connect_send(wreplconn->sock,
+ state->subreq = wrepl_connect_send(state,
+ service->task->event_ctx,
+ wreplconn->sock,
partner->our_address?partner->our_address:wrepl_best_ip(service->task->lp_ctx, partner->address),
partner->address);
- if (!state->c_req) goto failed;
+ if (!state->subreq) goto failed;
- state->c_req->async.fn = wreplsrv_out_connect_handler_creq;
- state->c_req->async.private_data = state;
+ tevent_req_set_callback(state->subreq,
+ wreplsrv_out_connect_handler_treq,
+ state);
return c;
failed: