summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2013-08-13 09:50:29 +0200
committerStefan Metzmacher <metze@samba.org>2013-08-15 09:07:06 +0200
commit318735fd5e15c5fd7010c0f657c86d27b45279ac (patch)
tree63fa1f2ecf55733a612896e88bc957307e94a67e
parent1229881df6bd22d4b5055ad283061332ba1c9bc8 (diff)
downloadsamba-318735fd5e15c5fd7010c0f657c86d27b45279ac.tar.gz
samba-318735fd5e15c5fd7010c0f657c86d27b45279ac.tar.bz2
samba-318735fd5e15c5fd7010c0f657c86d27b45279ac.zip
libcli/smb: calculate the credit charge on the input and output dyn_len
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
-rw-r--r--libcli/smb/smbXcli_base.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/libcli/smb/smbXcli_base.c b/libcli/smb/smbXcli_base.c
index 3b24f9a07a..7d7df144f7 100644
--- a/libcli/smb/smbXcli_base.c
+++ b/libcli/smb/smbXcli_base.c
@@ -246,6 +246,11 @@ struct smbXcli_req_state {
*/
struct iovec *recv_iov;
+ /*
+ * the expected max for the response dyn_len
+ */
+ uint32_t max_dyn_len;
+
uint16_t credit_charge;
bool should_sign;
@@ -2788,7 +2793,12 @@ NTSTATUS smb2cli_req_compound_submit(struct tevent_req **reqs,
}
if (state->conn->smb2.server.capabilities & SMB2_CAP_LARGE_MTU) {
- charge = (MAX(state->smb2.dyn_len, 1) - 1)/ 65536 + 1;
+ uint32_t max_dyn_len = 1;
+
+ max_dyn_len = MAX(max_dyn_len, state->smb2.dyn_len);
+ max_dyn_len = MAX(max_dyn_len, state->smb2.max_dyn_len);
+
+ charge = (max_dyn_len - 1)/ 65536 + 1;
} else {
charge = 1;
}