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 2017/05/09 20:03:01 UTC
[10/50] httpcomponents-core git commit: 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
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
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpcore/branches/4.2.x@1418951 13f79535-47bb-0310-9956-ffa450edef68
Project: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/repo
Commit: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/commit/e8063d96
Tree: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/tree/e8063d96
Diff: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/diff/e8063d96
Branch: refs/heads/4.2.x
Commit: e8063d965d1f522e318b7f3ed186a951307b59a0
Parents: 522e23f
Author: Oleg Kalnichevski <ol...@apache.org>
Authored: Sun Dec 9 13:42:10 2012 +0000
Committer: Oleg Kalnichevski <ol...@apache.org>
Committed: Sun Dec 9 13:42:10 2012 +0000
----------------------------------------------------------------------
.../java/org/apache/http/nio/reactor/ssl/SSLIOSession.java | 6 ++++++
1 file changed, 6 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/e8063d96/httpcore-nio/src/main/java/org/apache/http/nio/reactor/ssl/SSLIOSession.java
----------------------------------------------------------------------
diff --git a/httpcore-nio/src/main/java/org/apache/http/nio/reactor/ssl/SSLIOSession.java b/httpcore-nio/src/main/java/org/apache/http/nio/reactor/ssl/SSLIOSession.java
index 1a08f5c..2613b66 100644
--- a/httpcore-nio/src/main/java/org/apache/http/nio/reactor/ssl/SSLIOSession.java
+++ b/httpcore-nio/src/main/java/org/apache/http/nio/reactor/ssl/SSLIOSession.java
@@ -288,10 +288,16 @@ public class SSLIOSession implements IOSession, SessionBufferStatus, SocketAcces
}
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;