diff options
author | Volker Lendecke <vl@samba.org> | 2009-03-29 13:28:18 +0200 |
---|---|---|
committer | Volker Lendecke <vl@samba.org> | 2009-04-06 21:32:07 +0200 |
commit | 097db28c5d2d1014ffe63430dbe6f944807faa5c (patch) | |
tree | 4e0617bd8f3828321489842d756dbeba1bd052b8 /source3/rpc_client | |
parent | 17b8d05b624bd87dfe3c996cd10be5a981007bac (diff) | |
download | samba-097db28c5d2d1014ffe63430dbe6f944807faa5c.tar.gz samba-097db28c5d2d1014ffe63430dbe6f944807faa5c.tar.bz2 samba-097db28c5d2d1014ffe63430dbe6f944807faa5c.zip |
Convert cli_write_andx to tevent_req
Diffstat (limited to 'source3/rpc_client')
-rw-r--r-- | source3/rpc_client/rpc_transport_np.c | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/source3/rpc_client/rpc_transport_np.c b/source3/rpc_client/rpc_transport_np.c index cc8f2e17c6..730a309acf 100644 --- a/source3/rpc_client/rpc_transport_np.c +++ b/source3/rpc_client/rpc_transport_np.c @@ -49,7 +49,7 @@ struct rpc_np_write_state { size_t written; }; -static void rpc_np_write_done(struct async_req *subreq); +static void rpc_np_write_done(struct tevent_req *subreq); static struct tevent_req *rpc_np_write_send(TALLOC_CTX *mem_ctx, struct event_context *ev, @@ -58,8 +58,7 @@ static struct tevent_req *rpc_np_write_send(TALLOC_CTX *mem_ctx, { struct rpc_transport_np_state *np_transport = talloc_get_type_abort( priv, struct rpc_transport_np_state); - struct tevent_req *req; - struct async_req *subreq; + struct tevent_req *req, *subreq; struct rpc_np_write_state *state; req = tevent_req_create(mem_ctx, &state, struct rpc_np_write_state); @@ -72,21 +71,17 @@ static struct tevent_req *rpc_np_write_send(TALLOC_CTX *mem_ctx, np_transport->fnum, 8, /* 8 means message mode. */ data, 0, size); - if (subreq == NULL) { - goto fail; + if (tevent_req_nomem(subreq, req)) { + return tevent_req_post(req, ev); } - subreq->async.fn = rpc_np_write_done; - subreq->async.priv = req; + tevent_req_set_callback(subreq, rpc_np_write_done, req); return req; - fail: - TALLOC_FREE(req); - return NULL; } -static void rpc_np_write_done(struct async_req *subreq) +static void rpc_np_write_done(struct tevent_req *subreq) { - struct tevent_req *req = talloc_get_type_abort( - subreq->async.priv, struct tevent_req); + struct tevent_req *req = tevent_req_callback_data( + subreq, struct tevent_req); struct rpc_np_write_state *state = tevent_req_data( req, struct rpc_np_write_state); NTSTATUS status; |