diff options
author | Volker Lendecke <vl@samba.org> | 2009-03-17 09:17:16 +0100 |
---|---|---|
committer | Volker Lendecke <vl@samba.org> | 2009-03-17 17:31:22 +0100 |
commit | 89543d6c7819fec7ab291f86cda1298ba93476be (patch) | |
tree | 49b713b7fa3b4e27b33198a1359d684fb3771b6c /source3/smbd | |
parent | c7dba467f268d0007c58e7de4985dc5386a44c6f (diff) | |
download | samba-89543d6c7819fec7ab291f86cda1298ba93476be.tar.gz samba-89543d6c7819fec7ab291f86cda1298ba93476be.tar.bz2 samba-89543d6c7819fec7ab291f86cda1298ba93476be.zip |
Convert np_write to tevent_req
Diffstat (limited to 'source3/smbd')
-rw-r--r-- | source3/smbd/ipc.c | 25 | ||||
-rw-r--r-- | source3/smbd/pipes.c | 28 |
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; |