From 041c699f3ae10d189405b93977e3143813fb4525 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 13 Sep 2010 16:37:10 +1000 Subject: s4-libnet: converted finddcs call to tevent_req Pair-Programmed-With: Andrew Bartlett --- source4/libnet/libnet_rpc.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'source4/libnet/libnet_rpc.c') diff --git a/source4/libnet/libnet_rpc.c b/source4/libnet/libnet_rpc.c index 138b926742..f4760d418a 100644 --- a/source4/libnet/libnet_rpc.c +++ b/source4/libnet/libnet_rpc.c @@ -223,7 +223,7 @@ struct rpc_connect_dc_state { }; -static void continue_lookup_dc(struct composite_context *ctx); +static void continue_lookup_dc(struct tevent_req *req); static void continue_rpc_connect(struct composite_context *ctx); @@ -243,7 +243,7 @@ static struct composite_context* libnet_RpcConnectDC_send(struct libnet_context { struct composite_context *c; struct rpc_connect_dc_state *s; - struct composite_context *lookup_dc_req; + struct tevent_req *lookup_dc_req; /* composite context allocation and setup */ c = composite_create(ctx, ctx->event_ctx); @@ -280,7 +280,7 @@ static struct composite_context* libnet_RpcConnectDC_send(struct libnet_context lookup_dc_req = libnet_LookupDCs_send(ctx, c, &s->f); if (composite_nomem(lookup_dc_req, c)) return c; - composite_continue(c, lookup_dc_req, continue_lookup_dc, c); + tevent_req_set_callback(lookup_dc_req, continue_lookup_dc, c); return c; } @@ -289,19 +289,19 @@ static struct composite_context* libnet_RpcConnectDC_send(struct libnet_context Step 2 of RpcConnectDC: get domain controller name and initiate RpcConnect to it */ -static void continue_lookup_dc(struct composite_context *ctx) +static void continue_lookup_dc(struct tevent_req *req) { struct composite_context *c; struct rpc_connect_dc_state *s; struct composite_context *rpc_connect_req; struct monitor_msg msg; struct msg_net_lookup_dc data; - - c = talloc_get_type(ctx->async.private_data, struct composite_context); - s = talloc_get_type(c->private_data, struct rpc_connect_dc_state); + + c = tevent_req_callback_data(req, struct composite_context); + s = talloc_get_type_abort(c->private_data, struct rpc_connect_dc_state); /* receive result of domain controller lookup */ - c->status = libnet_LookupDCs_recv(ctx, c, &s->f); + c->status = libnet_LookupDCs_recv(req, c, &s->f); if (!composite_is_ok(c)) return; /* decide on preferred address type depending on DC type */ -- cgit