[jcifs] copyTo() Bug

Michael B Allen mba2000 at ioplex.com
Fri Jul 23 02:28:54 GMT 2004


When copying files between two servers that negotiate different buffer
sizes such as with the CopyTo example like:

java -Djcifs.properties=my.prp CopyTo smb://bigserver/foo/dir/
smb://tinyworksta/bar/dir/

The copyTo routine will attempt to write whatever amount of data is read.
But if the amount read is say 4900 but the snd_buf_size negotiated with
the destination server is only 4300 then copyTo will attempt to send 4900
bytes of data when the server is only willing to accept 4300. This will
result in the write hanging (response never received). This is bad!

I've fixed this (along with all of the other little issues that have
cropped up recently). I'll be releaing 0.9.6 soon....

One good thing is that I noticed the snd_buf_size defaulted to 5000 but
with the fix and changing this to 16644 (observed value from bigserver)
copyTo is noticably faster.

Mike


More information about the jcifs mailing list