diff options
author | Volker Lendecke <vl@samba.org> | 2009-03-08 10:20:27 +0100 |
---|---|---|
committer | Volker Lendecke <vl@samba.org> | 2009-03-08 11:21:00 +0100 |
commit | 80fcd764213afc430f4b4cefec4e251e668bd0ba (patch) | |
tree | a636c5c55ceaf078f3d615f62431a8589897bc10 /source3/lib/wb_reqtrans.c | |
parent | 0a3a7d53eb4d573aa6b1a1b9a9d81b848e37ac7f (diff) | |
download | samba-80fcd764213afc430f4b4cefec4e251e668bd0ba.tar.gz samba-80fcd764213afc430f4b4cefec4e251e668bd0ba.tar.bz2 samba-80fcd764213afc430f4b4cefec4e251e668bd0ba.zip |
Convert wb_resp_read to tevent_req
Diffstat (limited to 'source3/lib/wb_reqtrans.c')
-rw-r--r-- | source3/lib/wb_reqtrans.c | 31 |
1 files changed, 15 insertions, 16 deletions
diff --git a/source3/lib/wb_reqtrans.c b/source3/lib/wb_reqtrans.c index 30e5f75062..1f7713b02d 100644 --- a/source3/lib/wb_reqtrans.c +++ b/source3/lib/wb_reqtrans.c @@ -284,15 +284,14 @@ struct resp_read_state { static ssize_t wb_resp_more(uint8_t *buf, size_t buflen, void *private_data); static void wb_resp_read_done(struct tevent_req *subreq); -struct async_req *wb_resp_read_send(TALLOC_CTX *mem_ctx, - struct tevent_context *ev, int fd) +struct tevent_req *wb_resp_read_send(TALLOC_CTX *mem_ctx, + struct tevent_context *ev, int fd) { - struct async_req *result; - struct tevent_req *subreq; + struct tevent_req *result, *subreq; struct resp_read_state *state; - if (!async_req_setup(mem_ctx, &result, &state, - struct resp_read_state)) { + result = tevent_req_create(mem_ctx, &state, struct resp_read_state); + if (result == NULL) { return NULL; } @@ -326,10 +325,10 @@ static ssize_t wb_resp_more(uint8_t *buf, size_t buflen, void *private_data) static void wb_resp_read_done(struct tevent_req *subreq) { - struct async_req *req = - tevent_req_callback_data(subreq, struct async_req); - struct resp_read_state *state = talloc_get_type_abort( - req->private_data, struct resp_read_state); + struct tevent_req *req = tevent_req_callback_data( + subreq, struct tevent_req); + struct resp_read_state *state = tevent_req_data( + req, struct resp_read_state); uint8_t *buf; int err; ssize_t ret; @@ -337,7 +336,7 @@ static void wb_resp_read_done(struct tevent_req *subreq) ret = read_packet_recv(subreq, state, &buf, &err); TALLOC_FREE(subreq); if (ret == -1) { - async_req_error(req, map_wbc_err_from_errno(err)); + tevent_req_error(req, map_wbc_err_from_errno(err)); return; } @@ -349,17 +348,17 @@ static void wb_resp_read_done(struct tevent_req *subreq) } else { state->wb_resp->extra_data.data = NULL; } - async_req_done(req); + tevent_req_done(req); } -wbcErr wb_resp_read_recv(struct async_req *req, TALLOC_CTX *mem_ctx, +wbcErr wb_resp_read_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx, struct winbindd_response **presp) { - struct resp_read_state *state = talloc_get_type_abort( - req->private_data, struct resp_read_state); + struct resp_read_state *state = tevent_req_data( + req, struct resp_read_state); wbcErr wbc_err; - if (async_req_is_wbcerr(req, &wbc_err)) { + if (tevent_req_is_wbcerr(req, &wbc_err)) { return wbc_err; } *presp = talloc_move(mem_ctx, &state->wb_resp); |