From 43fb7f1698c0c8aaa7f1e5d6a0f924396a9a12fe Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Mon, 11 Oct 2010 08:54:27 +0200 Subject: libcli/nbt: convert nbt_name_refresh_wins_send/recv to tevent_req metze --- source4/nbt_server/wins/winsclient.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'source4/nbt_server') diff --git a/source4/nbt_server/wins/winsclient.c b/source4/nbt_server/wins/winsclient.c index f6f6ff48ec..0c513d1ae0 100644 --- a/source4/nbt_server/wins/winsclient.c +++ b/source4/nbt_server/wins/winsclient.c @@ -74,15 +74,16 @@ struct nbtd_wins_refresh_state { /* called when a wins name refresh has completed */ -static void nbtd_wins_refresh_handler(struct composite_context *subreq) +static void nbtd_wins_refresh_handler(struct tevent_req *subreq) { NTSTATUS status; struct nbtd_wins_refresh_state *state = - talloc_get_type_abort(subreq->async.private_data, + tevent_req_callback_data(subreq, struct nbtd_wins_refresh_state); struct nbtd_iface_name *iname = state->iname; status = nbt_name_refresh_wins_recv(subreq, state, &state->io); + TALLOC_FREE(subreq); if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT)) { /* our WINS server is dead - start registration over from scratch */ @@ -139,7 +140,7 @@ static void nbtd_wins_refresh(struct tevent_context *ev, struct tevent_timer *te struct nbtd_iface_name *iname = talloc_get_type(private_data, struct nbtd_iface_name); struct nbtd_interface *iface = iname->iface; struct nbt_name_socket *nbtsock = wins_socket(iface); - struct composite_context *subreq; + struct tevent_req *subreq; struct nbtd_wins_refresh_state *state; state = talloc_zero(iname, struct nbtd_wins_refresh_state); @@ -162,14 +163,13 @@ static void nbtd_wins_refresh(struct tevent_context *ev, struct tevent_timer *te return; } - subreq = nbt_name_refresh_wins_send(nbtsock, &state->io); + subreq = nbt_name_refresh_wins_send(state, ev, nbtsock, &state->io); if (subreq == NULL) { talloc_free(state); return; } - subreq->async.fn = nbtd_wins_refresh_handler; - subreq->async.private_data = state; + tevent_req_set_callback(subreq, nbtd_wins_refresh_handler, state); } -- cgit