commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1084695 - /commons/proper/net/trunk/src/main/java/org/apache/commons/net/imap/IMAP.java
Date Wed, 23 Mar 2011 19:46:56 GMT
Author: sebb
Date: Wed Mar 23 19:46:55 2011
New Revision: 1084695

URL: http://svn.apache.org/viewvc?rev=1084695&view=rev
Log:
Restore temporary timeout setting

Modified:
    commons/proper/net/trunk/src/main/java/org/apache/commons/net/imap/IMAP.java

Modified: commons/proper/net/trunk/src/main/java/org/apache/commons/net/imap/IMAP.java
URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/org/apache/commons/net/imap/IMAP.java?rev=1084695&r1=1084694&r2=1084695&view=diff
==============================================================================
--- commons/proper/net/trunk/src/main/java/org/apache/commons/net/imap/IMAP.java (original)
+++ commons/proper/net/trunk/src/main/java/org/apache/commons/net/imap/IMAP.java Wed Mar 23
19:46:55 2011
@@ -179,9 +179,14 @@ public class IMAP extends SocketClient
         __writer =
           new BufferedWriter(new OutputStreamWriter(_output_,
                                                     __DEFAULT_ENCODING));
-        setSoTimeout(connectTimeout); // TODO
-        System.out.println("Connected");
+        int tmo = getSoTimeout();
+        if (tmo <= 0) { // none set currently
+            setSoTimeout(connectTimeout); // use connect timeout to ensure we don't block
forever
+        }
         __getReply();
+        if (tmo <= 0) {
+            setSoTimeout(tmo); // restore the original value
+        }
         setState(IMAPState.NOT_AUTH_STATE);
     }
 



Mime
View raw message