[jcifs] Interrupted connect

Thomas Krammer Thomas_Krammer at avid.com
Wed Nov 23 13:39:52 GMT 2005


Hi everyone,

I found a bug in jcifs.util.transport.Transport. If the thread executing 
Transport.connect() is interrupted all following connect() calls fail 
with a TransportException "Invalid state: 1".

The reason for this is that the state isn't reset by the 
InterruptedException handler.

The attached patch fixes this problem.


Bye,

   Thomas
-------------- next part --------------
--- jcifs\util\transport\Transport.java	Fri Nov 18 16:21:24 2005
+++ ..\..\jcifs_1.2.6\src\jcifs\util\transport\Transport.java	Wed Nov 23 13:13:33 2005
@@ -167,6 +167,8 @@
             try {
                 thread.wait( timeout );          /* wait for doConnect */
             } catch( InterruptedException ie ) {
+                state = 0;
+                thread = null;
                 throw new TransportException( ie );
             }
 


More information about the jcifs mailing list