summaryrefslogtreecommitdiff
path: root/source3/lib
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2009-03-08 10:04:04 +0100
committerVolker Lendecke <vl@samba.org>2009-03-08 11:21:00 +0100
commit0a3a7d53eb4d573aa6b1a1b9a9d81b848e37ac7f (patch)
treeb9d8a49bc4d284a4b8474a45b8c377410490cebb /source3/lib
parent9a64d7cfbedec6fc634b523c2185213c136a5074 (diff)
downloadsamba-0a3a7d53eb4d573aa6b1a1b9a9d81b848e37ac7f.tar.gz
samba-0a3a7d53eb4d573aa6b1a1b9a9d81b848e37ac7f.tar.bz2
samba-0a3a7d53eb4d573aa6b1a1b9a9d81b848e37ac7f.zip
Convert wb_req_read to tevent_req
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/wb_reqtrans.c33
1 files changed, 16 insertions, 17 deletions
diff --git a/source3/lib/wb_reqtrans.c b/source3/lib/wb_reqtrans.c
index 9fcef0bb76..30e5f75062 100644
--- a/source3/lib/wb_reqtrans.c
+++ b/source3/lib/wb_reqtrans.c
@@ -121,16 +121,15 @@ wbcErr tevent_req_simple_recv_wbcerr(struct tevent_req *req)
static ssize_t wb_req_more(uint8_t *buf, size_t buflen, void *private_data);
static void wb_req_read_done(struct tevent_req *subreq);
-struct async_req *wb_req_read_send(TALLOC_CTX *mem_ctx,
- struct tevent_context *ev,
- int fd, size_t max_extra_data)
+struct tevent_req *wb_req_read_send(TALLOC_CTX *mem_ctx,
+ struct tevent_context *ev,
+ int fd, size_t max_extra_data)
{
- struct async_req *result;
- struct tevent_req *subreq;
+ struct tevent_req *result, *subreq;
struct req_read_state *state;
- if (!async_req_setup(mem_ctx, &result, &state,
- struct req_read_state)) {
+ result = tevent_req_create(mem_ctx, &state, struct req_read_state);
+ if (result == NULL) {
return NULL;
}
state->max_extra_data = max_extra_data;
@@ -176,10 +175,10 @@ static ssize_t wb_req_more(uint8_t *buf, size_t buflen, void *private_data)
static void wb_req_read_done(struct tevent_req *subreq)
{
- struct async_req *req =
- tevent_req_callback_data(subreq, struct async_req);
- struct req_read_state *state = talloc_get_type_abort(
- req->private_data, struct req_read_state);
+ struct tevent_req *req = tevent_req_callback_data(
+ subreq, struct tevent_req);
+ struct req_read_state *state = tevent_req_data(
+ req, struct req_read_state);
int err;
ssize_t ret;
uint8_t *buf;
@@ -187,7 +186,7 @@ static void wb_req_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;
}
@@ -199,17 +198,17 @@ static void wb_req_read_done(struct tevent_req *subreq)
} else {
state->wb_req->extra_data.data = NULL;
}
- async_req_done(req);
+ tevent_req_done(req);
}
-wbcErr wb_req_read_recv(struct async_req *req, TALLOC_CTX *mem_ctx,
+wbcErr wb_req_read_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
struct winbindd_request **preq)
{
- struct req_read_state *state = talloc_get_type_abort(
- req->private_data, struct req_read_state);
+ struct req_read_state *state = tevent_req_data(
+ req, struct req_read_state);
wbcErr wbc_err;
- if (async_req_is_wbcerr(req, &wbc_err)) {
+ if (tevent_req_is_wbcerr(req, &wbc_err)) {
return wbc_err;
}
*preq = talloc_move(mem_ctx, &state->wb_req);