diff options
author | Luk Claes <luk@debian.org> | 2012-05-10 18:40:56 +0200 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2012-05-12 01:01:31 +0200 |
commit | c7a129262857ede4d4985a1c368b7066811ed2c3 (patch) | |
tree | 833088031d9a2f5c9a1bd184a8b90112f040cdaf /source3/libsmb | |
parent | 50d88c96bc03206b59a882669ab13f763945d41f (diff) | |
download | samba-c7a129262857ede4d4985a1c368b7066811ed2c3.tar.gz samba-c7a129262857ede4d4985a1c368b7066811ed2c3.tar.bz2 samba-c7a129262857ede4d4985a1c368b7066811ed2c3.zip |
s3/libsmb: Generalise cli_state in smb2 write calls
Signed-off-by: Luk Claes <luk@debian.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Diffstat (limited to 'source3/libsmb')
-rw-r--r-- | source3/libsmb/cli_np_tstream.c | 20 | ||||
-rw-r--r-- | source3/libsmb/smb2cli.h | 10 | ||||
-rw-r--r-- | source3/libsmb/smb2cli_write.c | 25 |
3 files changed, 36 insertions, 19 deletions
diff --git a/source3/libsmb/cli_np_tstream.c b/source3/libsmb/cli_np_tstream.c index 9bf5611d96..53e0c41d8c 100644 --- a/source3/libsmb/cli_np_tstream.c +++ b/source3/libsmb/cli_np_tstream.c @@ -473,14 +473,18 @@ static void tstream_cli_np_writev_write_next(struct tevent_req *req) 0, /* offset */ cli_nps->write.ofs); /* size */ } else { - subreq = smb2cli_write_send(state, state->ev, cli_nps->cli, - cli_nps->write.ofs, /* length */ - 0, /* offset */ - cli_nps->fid_persistent, - cli_nps->fid_volatile, - 0, /* remaining_bytes */ - 0, /* flags */ - cli_nps->write.buf); + subreq = smb2cli_write_send(state, state->ev, + cli_nps->cli->conn, + cli_nps->cli->timeout, + cli_nps->cli->smb2.session, + cli_nps->cli->smb2.tid, + cli_nps->write.ofs, /* length */ + 0, /* offset */ + cli_nps->fid_persistent, + cli_nps->fid_volatile, + 0, /* remaining_bytes */ + 0, /* flags */ + cli_nps->write.buf); } if (tevent_req_nomem(subreq, req)) { return; diff --git a/source3/libsmb/smb2cli.h b/source3/libsmb/smb2cli.h index e562945358..6fa77f4ff3 100644 --- a/source3/libsmb/smb2cli.h +++ b/source3/libsmb/smb2cli.h @@ -142,7 +142,10 @@ NTSTATUS smb2cli_read(struct smbXcli_conn *conn, struct tevent_req *smb2cli_write_send(TALLOC_CTX *mem_ctx, struct tevent_context *ev, - struct cli_state *cli, + struct smbXcli_conn *conn, + uint32_t timeout_msec, + struct smbXcli_session *session, + uint32_t tcon_id, uint32_t length, uint64_t offset, uint64_t fid_persistent, @@ -151,7 +154,10 @@ struct tevent_req *smb2cli_write_send(TALLOC_CTX *mem_ctx, uint32_t flags, const uint8_t *data); NTSTATUS smb2cli_write_recv(struct tevent_req *req); -NTSTATUS smb2cli_write(struct cli_state *cli, +NTSTATUS smb2cli_write(struct smbXcli_conn *conn, + uint32_t timeout_msec, + struct smbXcli_session *session, + uint32_t tcon_id, uint32_t length, uint64_t offset, uint64_t fid_persistent, diff --git a/source3/libsmb/smb2cli_write.c b/source3/libsmb/smb2cli_write.c index 3d7b667a50..e257b588be 100644 --- a/source3/libsmb/smb2cli_write.c +++ b/source3/libsmb/smb2cli_write.c @@ -34,7 +34,10 @@ static void smb2cli_write_done(struct tevent_req *subreq); struct tevent_req *smb2cli_write_send(TALLOC_CTX *mem_ctx, struct tevent_context *ev, - struct cli_state *cli, + struct smbXcli_conn *conn, + uint32_t timeout_msec, + struct smbXcli_session *session, + uint32_t tcon_id, uint32_t length, uint64_t offset, uint64_t fid_persistent, @@ -74,12 +77,12 @@ struct tevent_req *smb2cli_write_send(TALLOC_CTX *mem_ctx, dyn_len = sizeof(state->dyn_pad); } - subreq = smb2cli_req_send(state, ev, cli->conn, SMB2_OP_WRITE, + subreq = smb2cli_req_send(state, ev, conn, SMB2_OP_WRITE, 0, 0, /* flags */ - cli->timeout, - cli->smb2.pid, - cli->smb2.tid, - cli->smb2.session, + timeout_msec, + 0xFEFF, /* pid */ + tcon_id, + session, state->fixed, sizeof(state->fixed), dyn, dyn_len); if (tevent_req_nomem(subreq, req)) { @@ -115,7 +118,10 @@ NTSTATUS smb2cli_write_recv(struct tevent_req *req) return tevent_req_simple_recv_ntstatus(req); } -NTSTATUS smb2cli_write(struct cli_state *cli, +NTSTATUS smb2cli_write(struct smbXcli_conn *conn, + uint32_t timeout_msec, + struct smbXcli_session *session, + uint32_t tcon_id, uint32_t length, uint64_t offset, uint64_t fid_persistent, @@ -129,7 +135,7 @@ NTSTATUS smb2cli_write(struct cli_state *cli, struct tevent_req *req; NTSTATUS status = NT_STATUS_NO_MEMORY; - if (cli_has_async_calls(cli)) { + if (smbXcli_conn_has_async_calls(conn)) { /* * Can't use sync call while an async call is in flight */ @@ -140,7 +146,8 @@ NTSTATUS smb2cli_write(struct cli_state *cli, if (ev == NULL) { goto fail; } - req = smb2cli_write_send(frame, ev, cli, length, offset, + req = smb2cli_write_send(frame, ev, conn, timeout_msec, session, + tcon_id, length, offset, fid_persistent, fid_volatile, remaining_bytes, flags, data); if (req == NULL) { |