From a15fd8376770a1e2191e561c93a93887f94fe347 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Tue, 13 Sep 2011 11:37:20 +0200 Subject: s3:libsmb: make use of cli_state_available_size() in cli_list_old_send() metze --- source3/libsmb/clilist.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'source3/libsmb') diff --git a/source3/libsmb/clilist.c b/source3/libsmb/clilist.c index ac10795920..521afc9aba 100644 --- a/source3/libsmb/clilist.c +++ b/source3/libsmb/clilist.c @@ -298,6 +298,7 @@ static struct tevent_req *cli_list_old_send(TALLOC_CTX *mem_ctx, struct cli_list_old_state *state; uint8_t *bytes; static const uint16_t zero = 0; + uint32_t usable_space; req = tevent_req_create(mem_ctx, &state, struct cli_list_old_state); if (req == NULL) { @@ -311,7 +312,8 @@ static struct tevent_req *cli_list_old_send(TALLOC_CTX *mem_ctx, if (tevent_req_nomem(state->mask, req)) { return tevent_req_post(req, ev); } - state->num_asked = (cli->max_xmit - 100) / DIR_STRUCT_SIZE; + usable_space = cli_state_available_size(cli, 100); + state->num_asked = usable_space / DIR_STRUCT_SIZE; SSVAL(state->vwv + 0, 0, state->num_asked); SSVAL(state->vwv + 1, 0, state->attribute); -- cgit