summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2008-01-14 13:46:06 -0800
committerJeremy Allison <jra@samba.org>2008-01-14 13:46:06 -0800
commitd7582b51863c44fdbffc8140a95950a3762d4b40 (patch)
treebbf168a8de8e67afc8e970e48fdf9bef5657e51f /source3
parentedd4cb0373a668c422b3aa2a460c1004682f3d1d (diff)
downloadsamba-d7582b51863c44fdbffc8140a95950a3762d4b40.tar.gz
samba-d7582b51863c44fdbffc8140a95950a3762d4b40.tar.bz2
samba-d7582b51863c44fdbffc8140a95950a3762d4b40.zip
Windows insists on write sizes < max_xmit on signed connections.
Jeremy. (This used to be commit ef9b278b6289a9ecdd6b103927058f64fbb7eb97)
Diffstat (limited to 'source3')
-rw-r--r--source3/libsmb/clireadwrite.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/source3/libsmb/clireadwrite.c b/source3/libsmb/clireadwrite.c
index 0b33e43563..6b39a885f0 100644
--- a/source3/libsmb/clireadwrite.c
+++ b/source3/libsmb/clireadwrite.c
@@ -404,6 +404,9 @@ ssize_t cli_write(struct cli_state *cli,
mpx = 1;
}
+ /* Default (small) writesize. */
+ writesize = (cli->max_xmit - (smb_size+32)) & ~1023;
+
if (write_mode == 0 &&
!client_is_signing_on(cli) &&
!cli_encryption_on(cli) &&
@@ -415,11 +418,11 @@ ssize_t cli_write(struct cli_state *cli,
} else if (cli->capabilities & CAP_LARGE_WRITEX) {
if (cli->is_samba) {
writesize = CLI_SAMBA_MAX_LARGE_WRITEX_SIZE;
- } else {
+ } else if (!client_is_signing_on(cli)) {
+ /* Windows restricts signed writes to max_xmit.
+ * Found by Volker. */
writesize = CLI_WINDOWS_MAX_LARGE_WRITEX_SIZE;
}
- } else {
- writesize = (cli->max_xmit - (smb_size+32)) & ~1023;
}
blocks = (size + (writesize-1)) / writesize;