mirror of
https://github.com/samba-team/samba.git
synced 2025-01-12 09:18:10 +03:00
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>
This commit is contained in:
parent
73cc454af0
commit
3c6808d5ed
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user