diff options
author | Stefan Metzmacher <metze@samba.org> | 2011-09-13 16:30:56 +0200 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2011-09-13 18:12:23 +0200 |
commit | 7c405fd92caf54bf5d9adce51f2635d13c1fe6f8 (patch) | |
tree | 7d7c7b7e00b6dd4c34d7c784488125be2c6aab80 /source3 | |
parent | c5072534bc4a49d6870dda86379353d313e655e7 (diff) | |
download | samba-7c405fd92caf54bf5d9adce51f2635d13c1fe6f8.tar.gz samba-7c405fd92caf54bf5d9adce51f2635d13c1fe6f8.tar.bz2 samba-7c405fd92caf54bf5d9adce51f2635d13c1fe6f8.zip |
s3:libsmb: make use of cli_state_max_requests() in cli_push_send()
metze
Diffstat (limited to 'source3')
-rw-r--r-- | source3/libsmb/clireadwrite.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/source3/libsmb/clireadwrite.c b/source3/libsmb/clireadwrite.c index 83fd5bdb0b..cd732529e9 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 *, |