You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hc.apache.org by ol...@apache.org on 2016/07/23 10:57:06 UTC

svn commit: r1753866 - /httpcomponents/httpcore/branches/4.4.x/httpcore-nio/src/main/java/org/apache/http/nio/reactor/ssl/SSLIOSession.java

Author: olegk
Date: Sat Jul 23 10:57:06 2016
New Revision: 1753866

URL: http://svn.apache.org/viewvc?rev=1753866&view=rev
Log:
HTTPCORE-427: SSL i/o sessions to use a finite timeout for SSL shutdown handshake when closing

Modified:
    httpcomponents/httpcore/branches/4.4.x/httpcore-nio/src/main/java/org/apache/http/nio/reactor/ssl/SSLIOSession.java

Modified: httpcomponents/httpcore/branches/4.4.x/httpcore-nio/src/main/java/org/apache/http/nio/reactor/ssl/SSLIOSession.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/branches/4.4.x/httpcore-nio/src/main/java/org/apache/http/nio/reactor/ssl/SSLIOSession.java?rev=1753866&r1=1753865&r2=1753866&view=diff
==============================================================================
--- httpcomponents/httpcore/branches/4.4.x/httpcore-nio/src/main/java/org/apache/http/nio/reactor/ssl/SSLIOSession.java (original)
+++ httpcomponents/httpcore/branches/4.4.x/httpcore-nio/src/main/java/org/apache/http/nio/reactor/ssl/SSLIOSession.java Sat Jul 23 10:57:06 2016
@@ -44,8 +44,8 @@ import javax.net.ssl.SSLException;
 import javax.net.ssl.SSLSession;
 
 import org.apache.http.HttpHost;
-import org.apache.http.annotation.ThreadingBehavior;
 import org.apache.http.annotation.Contract;
+import org.apache.http.annotation.ThreadingBehavior;
 import org.apache.http.nio.reactor.EventMask;
 import org.apache.http.nio.reactor.IOSession;
 import org.apache.http.nio.reactor.SessionBufferStatus;
@@ -628,10 +628,10 @@ public class SSLIOSession implements IOS
         if (this.status >= CLOSING) {
             return;
         }
-
-        // deactivating buffers in here causes failed tests
-
         this.status = CLOSING;
+        if (this.session.getSocketTimeout() == 0) {
+            this.session.setSocketTimeout(1000);
+        }
         this.sslEngine.closeOutbound();
         updateEventMask();
     }