diff options
author | Stefan Metzmacher <metze@samba.org> | 2010-10-11 21:58:29 +0200 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2010-10-18 15:36:15 +0000 |
commit | e3a0463414ba7759d332d5bebf6222bfa17ed037 (patch) | |
tree | efb8a9adc35ea7d353c604191bb01c670bb96b10 /source4 | |
parent | 4f233c7ff8b23b0dd4797e08d7dc680598e1b844 (diff) | |
download | samba-e3a0463414ba7759d332d5bebf6222bfa17ed037.tar.gz samba-e3a0463414ba7759d332d5bebf6222bfa17ed037.tar.bz2 samba-e3a0463414ba7759d332d5bebf6222bfa17ed037.zip |
libcli/nbt: convert nbt_name_register_wins_send/recv to tevent_req
metze
Diffstat (limited to 'source4')
-rw-r--r-- | source4/nbt_server/wins/winsclient.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/source4/nbt_server/wins/winsclient.c b/source4/nbt_server/wins/winsclient.c index d406a10002..60d2b94dec 100644 --- a/source4/nbt_server/wins/winsclient.c +++ b/source4/nbt_server/wins/winsclient.c @@ -180,15 +180,16 @@ struct nbtd_wins_register_state { /* called when a wins name register has completed */ -static void nbtd_wins_register_handler(struct composite_context *subreq) +static void nbtd_wins_register_handler(struct tevent_req *subreq) { NTSTATUS status; struct nbtd_wins_register_state *state = - talloc_get_type_abort(subreq->async.private_data, + tevent_req_callback_data(subreq, struct nbtd_wins_register_state); struct nbtd_iface_name *iname = state->iname; status = nbt_name_register_wins_recv(subreq, state, &state->io); + TALLOC_FREE(subreq); if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT)) { /* none of the WINS servers responded - try again periodically */ @@ -248,7 +249,7 @@ void nbtd_winsclient_register(struct nbtd_iface_name *iname) struct nbtd_interface *iface = iname->iface; struct nbt_name_socket *nbtsock = wins_socket(iface); struct nbtd_wins_register_state *state; - struct composite_context *subreq; + struct tevent_req *subreq; state = talloc_zero(iname, struct nbtd_wins_register_state); if (state == NULL) { @@ -270,12 +271,12 @@ void nbtd_winsclient_register(struct nbtd_iface_name *iname) return; } - subreq = nbt_name_register_wins_send(nbtsock, &state->io); + subreq = nbt_name_register_wins_send(state, iface->nbtsrv->task->event_ctx, + nbtsock, &state->io); if (subreq == NULL) { talloc_free(state); return; } - subreq->async.fn = nbtd_wins_register_handler; - subreq->async.private_data = state; + tevent_req_set_callback(subreq, nbtd_wins_register_handler, state); } |