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 2013/01/18 23:04:40 UTC
svn commit: r1435369 -
/httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/reactor/ssl/SSLIOSession.java
Author: olegk
Date: Fri Jan 18 22:04:40 2013
New Revision: 1435369
URL: http://svn.apache.org/viewvc?rev=1435369&view=rev
Log:
HTTPCORE-319: terminate non-blocking SSLIOSession if the SSL handshake is aborted by the oppositve endpoint leaving the SSL engine in the NEED_UNWRAP state
Modified:
httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/reactor/ssl/SSLIOSession.java
Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/reactor/ssl/SSLIOSession.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/reactor/ssl/SSLIOSession.java?rev=1435369&r1=1435368&r2=1435369&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/reactor/ssl/SSLIOSession.java (original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/reactor/ssl/SSLIOSession.java Fri Jan 18 22:04:40 2013
@@ -285,10 +285,16 @@ public class SSLIOSession implements IOS
}
private void updateEventMask() {
+ // Graceful session termination
if (this.status == CLOSING && this.sslEngine.isOutboundDone()
&& (this.endOfStream || this.sslEngine.isInboundDone())) {
this.status = CLOSED;
}
+ // Abnormal session termination
+ if (this.status == ACTIVE && this.endOfStream
+ && this.sslEngine.getHandshakeStatus() == HandshakeStatus.NEED_UNWRAP) {
+ this.status = CLOSED;
+ }
if (this.status == CLOSED) {
this.session.close();
return;