summaryrefslogtreecommitdiff
path: root/source3/smbd/ipc.c
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2009-03-17 09:34:17 +0100
committerVolker Lendecke <vl@samba.org>2009-03-17 17:31:22 +0100
commitbce98d8c031f9f093ec3adfcf6de9a61cdd3730e (patch)
tree38af88a3d7758340a57c2d85ec91e35822ad2df9 /source3/smbd/ipc.c
parent89543d6c7819fec7ab291f86cda1298ba93476be (diff)
downloadsamba-bce98d8c031f9f093ec3adfcf6de9a61cdd3730e.tar.gz
Convert np_read to tevent_req
Diffstat (limited to 'source3/smbd/ipc.c')
-rw-r--r--source3/smbd/ipc.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/source3/smbd/ipc.c b/source3/smbd/ipc.c
index 4383897c575..f20c8512975 100644
--- a/source3/smbd/ipc.c
+++ b/source3/smbd/ipc.c
@@ -212,7 +212,7 @@ struct dcerpc_cmd_state {
};
static void api_dcerpc_cmd_write_done(struct tevent_req *subreq);
-static void api_dcerpc_cmd_read_done(struct async_req *subreq);
+static void api_dcerpc_cmd_read_done(struct tevent_req *subreq);
static void api_dcerpc_cmd(connection_struct *conn, struct smb_request *req,
files_struct *fsp, uint8_t *data, size_t length,
@@ -264,7 +264,6 @@ static void api_dcerpc_cmd_write_done(struct tevent_req *subreq)
subreq, struct smb_request);
struct dcerpc_cmd_state *state = talloc_get_type_abort(
req->async_priv, struct dcerpc_cmd_state);
- struct async_req *subreq2;
NTSTATUS status;
ssize_t nwritten = -1;
@@ -285,15 +284,13 @@ static void api_dcerpc_cmd_write_done(struct tevent_req *subreq)
goto send;
}
- subreq2 = np_read_send(req->conn, smbd_event_context(),
- state->handle, state->data, state->max_read);
- if (subreq2 == NULL) {
+ subreq = np_read_send(req->conn, smbd_event_context(),
+ state->handle, state->data, state->max_read);
+ if (subreq == NULL) {
reply_nterror(req, NT_STATUS_NO_MEMORY);
goto send;
}
-
- subreq2->async.fn = api_dcerpc_cmd_read_done;
- subreq2->async.priv = req;
+ tevent_req_set_callback(subreq, api_dcerpc_cmd_read_done, req);
return;
send:
@@ -306,10 +303,10 @@ static void api_dcerpc_cmd_write_done(struct tevent_req *subreq)
TALLOC_FREE(req);
}
-static void api_dcerpc_cmd_read_done(struct async_req *subreq)
+static void api_dcerpc_cmd_read_done(struct tevent_req *subreq)
{
- struct smb_request *req = talloc_get_type_abort(
- subreq->async.priv, struct smb_request);
+ struct smb_request *req = tevent_req_callback_data(
+ subreq, struct smb_request);
struct dcerpc_cmd_state *state = talloc_get_type_abort(
req->async_priv, struct dcerpc_cmd_state);
NTSTATUS status;