From b2df91639065168643ea8b921f24b879daf2e71f Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 29 Oct 2004 05:31:35 +0000 Subject: r3352: make smbcli_read() and smbcli_write() work with very small negotiated SMB buffer sizes (This used to be commit 320ca0214d97dc6cebb00ddc98a1eb71e2b4c917) --- source4/libcli/clireadwrite.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'source4/libcli/clireadwrite.c') diff --git a/source4/libcli/clireadwrite.c b/source4/libcli/clireadwrite.c index 45c99f4f89..f8220526e3 100644 --- a/source4/libcli/clireadwrite.c +++ b/source4/libcli/clireadwrite.c @@ -42,8 +42,7 @@ ssize_t smbcli_read(struct smbcli_tree *tree, int fnum, char *buf, off_t offset, * Set readsize to the maximum size we can handle in one readX, * rounded down to a multiple of 1024. */ - readsize = (tree->session->transport->negotiate.max_xmit - - (MIN_SMB_SIZE+32)) & ~1023; + readsize = (tree->session->transport->negotiate.max_xmit - (MIN_SMB_SIZE+32)); if (readsize > 0xFFFF) readsize = 0xFFFF; while (total < size) { @@ -87,7 +86,7 @@ ssize_t smbcli_write(struct smbcli_tree *tree, const uint8_t *buf, off_t offset, size_t size) { union smb_write parms; - int block = (tree->session->transport->negotiate.max_xmit - (MIN_SMB_SIZE+32)) & ~1023; + int block = (tree->session->transport->negotiate.max_xmit - (MIN_SMB_SIZE+32)); ssize_t total = 0; if (size == 0) { -- cgit