diff options
author | Luk Claes <luk@debian.org> | 2012-05-10 18:30:25 +0200 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2012-05-12 00:43:53 +0200 |
commit | 14473f37f5a3cd4749f5c4f937fef37cc5ea8c47 (patch) | |
tree | 940c38236d6810374f38909d715cc0893fa0ed77 /source3/libsmb | |
parent | 0048dd95cda1f80bbf3bac9bf50d1cc129681f49 (diff) | |
download | samba-14473f37f5a3cd4749f5c4f937fef37cc5ea8c47.tar.gz samba-14473f37f5a3cd4749f5c4f937fef37cc5ea8c47.tar.bz2 samba-14473f37f5a3cd4749f5c4f937fef37cc5ea8c47.zip |
s3-libsmb: Generalise cli_state in smb2 read 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 | 6 | ||||
-rw-r--r-- | source3/libsmb/smb2cli.h | 10 | ||||
-rw-r--r-- | source3/libsmb/smb2cli_read.c | 26 |
3 files changed, 30 insertions, 12 deletions
diff --git a/source3/libsmb/cli_np_tstream.c b/source3/libsmb/cli_np_tstream.c index 658f30850a..d52997fbdf 100644 --- a/source3/libsmb/cli_np_tstream.c +++ b/source3/libsmb/cli_np_tstream.c @@ -742,7 +742,11 @@ static void tstream_cli_np_readv_read_next(struct tevent_req *req) 0, /* offset */ TSTREAM_CLI_NP_MAX_BUF_SIZE); } else { - subreq = smb2cli_read_send(state, state->ev, cli_nps->cli, + subreq = smb2cli_read_send(state, state->ev, + cli_nps->cli->conn, + cli_nps->cli->timeout, + cli_nps->cli->smb2.session, + cli_nps->cli->smb2.tid, TSTREAM_CLI_NP_MAX_BUF_SIZE, /* length */ 0, /* offset */ cli_nps->fid_persistent, diff --git a/source3/libsmb/smb2cli.h b/source3/libsmb/smb2cli.h index 727481a520..12f061524e 100644 --- a/source3/libsmb/smb2cli.h +++ b/source3/libsmb/smb2cli.h @@ -94,7 +94,10 @@ NTSTATUS smb2cli_flush(struct cli_state *cli, struct tevent_req *smb2cli_read_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, @@ -103,7 +106,10 @@ struct tevent_req *smb2cli_read_send(TALLOC_CTX *mem_ctx, uint64_t remaining_bytes); NTSTATUS smb2cli_read_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx, uint8_t **data, uint32_t *data_length); -NTSTATUS smb2cli_read(struct cli_state *cli, +NTSTATUS smb2cli_read(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_read.c b/source3/libsmb/smb2cli_read.c index d01e33f42d..8f3362a4ab 100644 --- a/source3/libsmb/smb2cli_read.c +++ b/source3/libsmb/smb2cli_read.c @@ -37,7 +37,10 @@ static void smb2cli_read_done(struct tevent_req *subreq); struct tevent_req *smb2cli_read_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, @@ -65,12 +68,12 @@ struct tevent_req *smb2cli_read_send(TALLOC_CTX *mem_ctx, SBVAL(fixed, 32, minimum_count); SBVAL(fixed, 40, remaining_bytes); - subreq = smb2cli_req_send(state, ev, cli->conn, SMB2_OP_READ, + subreq = smb2cli_req_send(state, ev, conn, SMB2_OP_READ, 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), state->dyn_pad, sizeof(state->dyn_pad)); if (tevent_req_nomem(subreq, req)) { @@ -138,7 +141,10 @@ NTSTATUS smb2cli_read_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx, return NT_STATUS_OK; } -NTSTATUS smb2cli_read(struct cli_state *cli, +NTSTATUS smb2cli_read(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, @@ -154,7 +160,7 @@ NTSTATUS smb2cli_read(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 */ @@ -165,7 +171,9 @@ NTSTATUS smb2cli_read(struct cli_state *cli, if (ev == NULL) { goto fail; } - req = smb2cli_read_send(frame, ev, cli, length, offset, + req = smb2cli_read_send(frame, ev, + conn, timeout_msec, session, tcon_id, + length, offset, fid_persistent, fid_volatile, minimum_count, remaining_bytes); if (req == NULL) { |