summaryrefslogtreecommitdiff
path: root/source3/smbd
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
parent89543d6c7819fec7ab291f86cda1298ba93476be (diff)
downloadsamba-bce98d8c031f9f093ec3adfcf6de9a61cdd3730e.tar.gz
samba-bce98d8c031f9f093ec3adfcf6de9a61cdd3730e.tar.bz2
samba-bce98d8c031f9f093ec3adfcf6de9a61cdd3730e.zip
Convert np_read to tevent_req
Diffstat (limited to 'source3/smbd')
-rw-r--r--source3/smbd/ipc.c19
-rw-r--r--source3/smbd/pipes.c14
2 files changed, 15 insertions, 18 deletions
diff --git a/source3/smbd/ipc.c b/source3/smbd/ipc.c
index 4383897c57..f20c851297 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;
diff --git a/source3/smbd/pipes.c b/source3/smbd/pipes.c
index 69522ea992..2686cf41d9 100644
--- a/source3/smbd/pipes.c
+++ b/source3/smbd/pipes.c
@@ -340,14 +340,14 @@ struct pipe_read_andx_state {
int smb_maxcnt;
};
-static void pipe_read_andx_done(struct async_req *subreq);
+static void pipe_read_andx_done(struct tevent_req *subreq);
void reply_pipe_read_and_X(struct smb_request *req)
{
files_struct *fsp = file_fsp(req, SVAL(req->vwv+0, 0));
uint8_t *data;
struct pipe_read_andx_state *state;
- struct async_req *subreq;
+ struct tevent_req *subreq;
/* we don't use the offset given to use for pipe reads. This
is deliberate, instead we always return the next lump of
@@ -392,14 +392,14 @@ void reply_pipe_read_and_X(struct smb_request *req)
reply_nterror(req, NT_STATUS_NO_MEMORY);
return;
}
- subreq->async.fn = pipe_read_andx_done;
- subreq->async.priv = talloc_move(req->conn, &req);
+ tevent_req_set_callback(subreq, pipe_read_andx_done,
+ talloc_move(req->conn, &req));
}
-static void pipe_read_andx_done(struct async_req *subreq)
+static void pipe_read_andx_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 pipe_read_andx_state *state = talloc_get_type_abort(
req->async_priv, struct pipe_read_andx_state);
NTSTATUS status;