diff options
author | Andrew Tridgell <tridge@samba.org> | 2003-10-10 05:40:32 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2003-10-10 05:40:32 +0000 |
commit | 4e73a3c0feb47c761fdcded9e6c2ac6d32534d9b (patch) | |
tree | 567ab5fc754a3df597d07e2e5870fa0a35e2bf77 /source4/libcli | |
parent | b382acea72c8cc8325142b4dc8e182c75f5e476b (diff) | |
download | samba-4e73a3c0feb47c761fdcded9e6c2ac6d32534d9b.tar.gz samba-4e73a3c0feb47c761fdcded9e6c2ac6d32534d9b.tar.bz2 samba-4e73a3c0feb47c761fdcded9e6c2ac6d32534d9b.zip |
fixed snprintf.c for systems that have only some of the *printf() family of functions
cope with servers that return bogus (too large) values in max_xmit
cope with a couple more error conditions in RAW-SFILEINFO
better startup time heuristics in NBENCH
(This used to be commit 89f7261ba589e5760b3cf9c3594eab9d7198dd7e)
Diffstat (limited to 'source4/libcli')
-rw-r--r-- | source4/libcli/clireadwrite.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/source4/libcli/clireadwrite.c b/source4/libcli/clireadwrite.c index e1d154b283..1e6c0fc064 100644 --- a/source4/libcli/clireadwrite.c +++ b/source4/libcli/clireadwrite.c @@ -42,6 +42,7 @@ ssize_t cli_read(struct cli_state *cli, int fnum, char *buf, off_t offset, size_ * rounded down to a multiple of 1024. */ readsize = (cli->transport->negotiate.max_xmit - (MIN_SMB_SIZE+32)) & ~1023; + if (readsize > 0xFFFF) readsize = 0xFFFF; while (total < size) { NTSTATUS status; @@ -91,6 +92,9 @@ ssize_t cli_write(struct cli_state *cli, return 0; } + if (block > 0xFFFF) block = 0xFFFF; + + parms.writex.level = RAW_WRITE_WRITEX; parms.writex.in.fnum = fnum; parms.writex.in.wmode = write_mode; @@ -133,6 +137,7 @@ ssize_t cli_smbwrite(struct cli_state *cli, do { size_t size = MIN(size1, cli->transport->negotiate.max_xmit - 48); + if (size > 0xFFFF) size = 0xFFFF; parms.write.in.fnum = fnum; parms.write.in.offset = offset; |