From 7c405fd92caf54bf5d9adce51f2635d13c1fe6f8 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Tue, 13 Sep 2011 16:30:56 +0200 Subject: [PATCH] s3:libsmb: make use of cli_state_max_requests() in cli_push_send() metze --- source3/libsmb/clireadwrite.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/source3/libsmb/clireadwrite.c b/source3/libsmb/clireadwrite.c index 83fd5bdb0b9..cd732529e94 100644 --- a/source3/libsmb/clireadwrite.c +++ b/source3/libsmb/clireadwrite.c @@ -1083,6 +1083,7 @@ struct cli_push_state { * Outstanding requests */ uint32_t pending; + uint16_t max_reqs; uint32_t num_reqs; struct cli_push_write_state **reqs; }; @@ -1166,14 +1167,16 @@ struct tevent_req *cli_push_send(TALLOC_CTX *mem_ctx, struct event_context *ev, state->chunk_size = cli_write_max_bufsize(cli, mode, 14); + state->max_reqs = cli_state_max_requests(cli); + if (window_size == 0) { - window_size = cli->max_mux * state->chunk_size; + window_size = state->max_reqs * state->chunk_size; } state->num_reqs = window_size/state->chunk_size; if ((window_size % state->chunk_size) > 0) { state->num_reqs += 1; } - state->num_reqs = MIN(state->num_reqs, cli->max_mux); + state->num_reqs = MIN(state->num_reqs, state->max_reqs); state->num_reqs = MAX(state->num_reqs, 1); state->reqs = talloc_zero_array(state, struct cli_push_write_state *,