summaryrefslogtreecommitdiff
path: root/source3/smbd
diff options
context:
space:
mode:
Diffstat (limited to 'source3/smbd')
-rw-r--r--source3/smbd/ipc.c25
-rw-r--r--source3/smbd/pipes.c28
2 files changed, 27 insertions, 26 deletions
diff --git a/source3/smbd/ipc.c b/source3/smbd/ipc.c
index d18b5debe0..4383897c57 100644
--- a/source3/smbd/ipc.c
+++ b/source3/smbd/ipc.c
@@ -211,14 +211,14 @@ struct dcerpc_cmd_state {
size_t max_read;
};
-static void api_dcerpc_cmd_write_done(struct async_req *subreq);
+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(connection_struct *conn, struct smb_request *req,
files_struct *fsp, uint8_t *data, size_t length,
size_t max_read)
{
- struct async_req *subreq;
+ struct tevent_req *subreq;
struct dcerpc_cmd_state *state;
if (!fsp_is_np(fsp)) {
@@ -254,16 +254,17 @@ static void api_dcerpc_cmd(connection_struct *conn, struct smb_request *req,
reply_nterror(req, NT_STATUS_NO_MEMORY);
return;
}
- subreq->async.fn = api_dcerpc_cmd_write_done;
- subreq->async.priv = talloc_move(conn, &req);
+ tevent_req_set_callback(subreq, api_dcerpc_cmd_write_done,
+ talloc_move(conn, &req));
}
-static void api_dcerpc_cmd_write_done(struct async_req *subreq)
+static void api_dcerpc_cmd_write_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);
+ struct async_req *subreq2;
NTSTATUS status;
ssize_t nwritten = -1;
@@ -284,15 +285,15 @@ static void api_dcerpc_cmd_write_done(struct async_req *subreq)
goto send;
}
- subreq = np_read_send(req->conn, smbd_event_context(),
- state->handle, state->data, state->max_read);
- if (subreq == NULL) {
+ subreq2 = np_read_send(req->conn, smbd_event_context(),
+ state->handle, state->data, state->max_read);
+ if (subreq2 == NULL) {
reply_nterror(req, NT_STATUS_NO_MEMORY);
goto send;
}
- subreq->async.fn = api_dcerpc_cmd_read_done;
- subreq->async.priv = req;
+ subreq2->async.fn = api_dcerpc_cmd_read_done;
+ subreq2->async.priv = req;
return;
send:
diff --git a/source3/smbd/pipes.c b/source3/smbd/pipes.c
index 6fd4031f3d..69522ea992 100644
--- a/source3/smbd/pipes.c
+++ b/source3/smbd/pipes.c
@@ -148,14 +148,14 @@ struct pipe_write_state {
size_t numtowrite;
};
-static void pipe_write_done(struct async_req *subreq);
+static void pipe_write_done(struct tevent_req *subreq);
void reply_pipe_write(struct smb_request *req)
{
files_struct *fsp = file_fsp(req, SVAL(req->vwv+0, 0));
const uint8_t *data;
struct pipe_write_state *state;
- struct async_req *subreq;
+ struct tevent_req *subreq;
if (!fsp_is_np(fsp)) {
reply_doserror(req, ERRDOS, ERRbadfid);
@@ -188,14 +188,14 @@ void reply_pipe_write(struct smb_request *req)
reply_nterror(req, NT_STATUS_NO_MEMORY);
return;
}
- subreq->async.fn = pipe_write_done;
- subreq->async.priv = talloc_move(req->conn, &req);
+ tevent_req_set_callback(subreq, pipe_write_done,
+ talloc_move(req->conn, &req));
}
-static void pipe_write_done(struct async_req *subreq)
+static void pipe_write_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_write_state *state = talloc_get_type_abort(
req->async_priv, struct pipe_write_state);
NTSTATUS status;
@@ -235,7 +235,7 @@ struct pipe_write_andx_state {
size_t numtowrite;
};
-static void pipe_write_andx_done(struct async_req *subreq);
+static void pipe_write_andx_done(struct tevent_req *subreq);
void reply_pipe_write_and_X(struct smb_request *req)
{
@@ -243,7 +243,7 @@ void reply_pipe_write_and_X(struct smb_request *req)
int smb_doff = SVAL(req->vwv+11, 0);
uint8_t *data;
struct pipe_write_andx_state *state;
- struct async_req *subreq;
+ struct tevent_req *subreq;
if (!fsp_is_np(fsp)) {
reply_doserror(req, ERRDOS, ERRbadfid);
@@ -297,14 +297,14 @@ void reply_pipe_write_and_X(struct smb_request *req)
reply_nterror(req, NT_STATUS_NO_MEMORY);
return;
}
- subreq->async.fn = pipe_write_andx_done;
- subreq->async.priv = talloc_move(req->conn, &req);
+ tevent_req_set_callback(subreq, pipe_write_andx_done,
+ talloc_move(req->conn, &req));
}
-static void pipe_write_andx_done(struct async_req *subreq)
+static void pipe_write_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_write_andx_state *state = talloc_get_type_abort(
req->async_priv, struct pipe_write_andx_state);
NTSTATUS status;