7179879: SSLSocket connect times out instead of throwing socket closed exception
authorcoffeys
Thu, 26 Jul 2012 22:00:55 +0100
changeset 13370 785cedd026db
parent 13369 7382e4b019e7
child 13371 ccc8ddc94dda
7179879: SSLSocket connect times out instead of throwing socket closed exception Reviewed-by: xuelei, chegar
jdk/src/share/classes/sun/security/ssl/SSLSocketImpl.java
--- a/jdk/src/share/classes/sun/security/ssl/SSLSocketImpl.java	Thu Jul 26 20:38:44 2012 +0800
+++ b/jdk/src/share/classes/sun/security/ssl/SSLSocketImpl.java	Thu Jul 26 22:00:55 2012 +0100
@@ -1576,11 +1576,9 @@
         Throwable cachedThrowable = null;
         try {
             switch (state) {
-            /*
-             * java.net code sometimes closes sockets "early", when
-             * we can't actually do I/O on them.
-             */
             case cs_START:
+                // unconnected socket or handshaking has not been initialized
+                closeSocket(selfInitiated);
                 break;
 
             /*