[jcifs] Jcifs corrupted files after soTimeout

Autexier, Jean-Marc jm.autexier at syborg.de
Fri Apr 29 08:11:19 GMT 2005


Hi,

SmbTransport set 15000ms as DEFAULT_SO_TIMEOUT for the socket.

When you start writing a file, wait longer than DEFAULT_SO_TIMEOUT and
continue to write the file, the file will be corrupted. The
InterruptedIOException is catched by SmbTransport and not notified to
application.

You can reproduce it like this:

SmbFile smbFile2 = new
SmbFile("smb://"+domain+";"+user+":"+passwd+"@"+ip+file);
OutputStream out2 = new SmbFileOutputStream(smbFile2);
out2.write("hello1".getBytes());
out2.flush();	// just to be sure
// wait 30 sec
out2.write("hello2".getBytes());
out2.close() ;

The file contains: 0x00 0x00 0x00 0x00 0x00 0x00 0x68 0x65 0x6C 0x6F
0x32
Data's before the interupted exeption are wrong (they are correct in the
file before the exception happen). 

Jean-Marc


More information about the jcifs mailing list