summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2011-09-12 02:48:25 +0200
committerJeremy Allison <jra@samba.org>2011-09-14 13:12:16 -0700
commit3c6808d5ed4aee60f7c7ca242e64abf291fff110 (patch)
tree82e1242dc2247506c1294f741b2d25a7153fef50
parent73cc454af07f8e80d4f88730e492a5d1cf97f260 (diff)
downloadsamba-3c6808d5ed4aee60f7c7ca242e64abf291fff110.tar.gz
samba-3c6808d5ed4aee60f7c7ca242e64abf291fff110.tar.bz2
samba-3c6808d5ed4aee60f7c7ca242e64abf291fff110.zip
s3:libsmb: align chunk_size for cli_pull/push() to a page size of 1024 bytes
s3:libsmb: align chunk_size for cli_pull/push() to a page size of 1024 bytes metze Signed-off-by: Jeremy Allison <jra@samba.org>
-rw-r--r--source3/libsmb/clireadwrite.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/source3/libsmb/clireadwrite.c b/source3/libsmb/clireadwrite.c
index fe966ca8df..bbe6a81276 100644
--- a/source3/libsmb/clireadwrite.c
+++ b/source3/libsmb/clireadwrite.c
@@ -476,6 +476,7 @@ struct tevent_req *cli_pull_send(TALLOC_CTX *mem_ctx,
struct tevent_req *req;
struct cli_pull_state *state;
int i;
+ size_t page_size = 1024;
req = tevent_req_create(mem_ctx, &state, struct cli_pull_state);
if (req == NULL) {
@@ -501,6 +502,9 @@ struct tevent_req *cli_pull_send(TALLOC_CTX *mem_ctx,
}
state->chunk_size = cli_read_max_bufsize(cli);
+ if (state->chunk_size > page_size) {
+ state->chunk_size &= ~(page_size - 1);
+ }
state->max_reqs = cli_state_max_requests(cli);
@@ -1171,6 +1175,7 @@ struct tevent_req *cli_push_send(TALLOC_CTX *mem_ctx, struct event_context *ev,
struct tevent_req *req;
struct cli_push_state *state;
uint32_t i;
+ size_t page_size = 1024;
req = tevent_req_create(mem_ctx, &state, struct cli_push_state);
if (req == NULL) {
@@ -1188,6 +1193,9 @@ struct tevent_req *cli_push_send(TALLOC_CTX *mem_ctx, struct event_context *ev,
state->next_offset = start_offset;
state->chunk_size = cli_write_max_bufsize(cli, mode, 14);
+ if (state->chunk_size > page_size) {
+ state->chunk_size &= ~(page_size - 1);
+ }
state->max_reqs = cli_state_max_requests(cli);