summaryrefslogtreecommitdiff
path: root/source3/libsmb
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2011-09-13 11:34:33 +0200
committerStefan Metzmacher <metze@samba.org>2011-09-13 13:16:08 +0200
commitafda15aa868856a727d860d04b7c7c1277484fe1 (patch)
tree255f85da36760f749487ce5f50c6beb0690e18ac /source3/libsmb
parent2a5f8daa3e2563166413af75e53c8c2b90d22d8c (diff)
downloadsamba-afda15aa868856a727d860d04b7c7c1277484fe1.tar.gz
samba-afda15aa868856a727d860d04b7c7c1277484fe1.tar.bz2
samba-afda15aa868856a727d860d04b7c7c1277484fe1.zip
s3:libsmb: make use of cli_state_available_size() in cli_trans_format()
metze
Diffstat (limited to 'source3/libsmb')
-rw-r--r--source3/libsmb/clitrans.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/source3/libsmb/clitrans.c b/source3/libsmb/clitrans.c
index dd8063bf1e..91157b6698 100644
--- a/source3/libsmb/clitrans.c
+++ b/source3/libsmb/clitrans.c
@@ -184,6 +184,7 @@ static NTSTATUS cli_trans_pull_blob(TALLOC_CTX *mem_ctx,
static void cli_trans_format(struct cli_trans_state *state, uint8_t *pwct,
int *piov_count)
{
+ struct cli_state *cli = state->cli;
uint8_t wct = 0;
struct iovec *iov = state->iov;
uint8_t *pad = state->pad;
@@ -242,7 +243,7 @@ static void cli_trans_format(struct cli_trans_state *state, uint8_t *pwct,
}
param_offset += wct * sizeof(uint16_t);
- useable_space = state->cli->max_xmit - param_offset;
+ useable_space = cli_state_available_size(cli, param_offset);
param_pad = param_offset % 4;
if (param_pad > 0) {
@@ -252,7 +253,7 @@ static void cli_trans_format(struct cli_trans_state *state, uint8_t *pwct,
iov += 1;
param_offset += param_pad;
}
- useable_space = state->cli->max_xmit - param_offset;
+ useable_space = cli_state_available_size(cli, param_offset);
if (state->param_sent < state->num_param) {
this_param = MIN(state->num_param - state->param_sent,
@@ -263,7 +264,7 @@ static void cli_trans_format(struct cli_trans_state *state, uint8_t *pwct,
}
data_offset = param_offset + this_param;
- useable_space = state->cli->max_xmit - data_offset;
+ useable_space = cli_state_available_size(cli, data_offset);
data_pad = data_offset % 4;
if (data_pad > 0) {
@@ -273,7 +274,7 @@ static void cli_trans_format(struct cli_trans_state *state, uint8_t *pwct,
iov += 1;
data_offset += data_pad;
}
- useable_space = state->cli->max_xmit - data_offset;
+ useable_space = cli_state_available_size(cli, data_offset);
if (state->data_sent < state->num_data) {
this_data = MIN(state->num_data - state->data_sent,