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 13:11:53 UTC
svn commit: r1753870 -
/httpcomponents/httpcore/trunk/httpcore5/src/main/java/org/apache/hc/core5/reactor/ssl/SSLIOSession.java
Author: olegk
Date: Sat Jul 23 13:11:52 2016
New Revision: 1753870
URL: http://svn.apache.org/viewvc?rev=1753870&view=rev
Log:
HTTPCORE-428: SSLIOSession#close to handle CancelledKeyException
Modified:
httpcomponents/httpcore/trunk/httpcore5/src/main/java/org/apache/hc/core5/reactor/ssl/SSLIOSession.java
Modified: httpcomponents/httpcore/trunk/httpcore5/src/main/java/org/apache/hc/core5/reactor/ssl/SSLIOSession.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore5/src/main/java/org/apache/hc/core5/reactor/ssl/SSLIOSession.java?rev=1753870&r1=1753869&r2=1753870&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore5/src/main/java/org/apache/hc/core5/reactor/ssl/SSLIOSession.java (original)
+++ httpcomponents/httpcore/trunk/httpcore5/src/main/java/org/apache/hc/core5/reactor/ssl/SSLIOSession.java Sat Jul 23 13:11:52 2016
@@ -32,6 +32,7 @@ import java.net.Socket;
import java.net.SocketAddress;
import java.nio.ByteBuffer;
import java.nio.channels.ByteChannel;
+import java.nio.channels.CancelledKeyException;
import java.nio.channels.ClosedChannelException;
import java.nio.channels.SelectionKey;
@@ -617,7 +618,11 @@ public class SSLIOSession implements IOS
this.session.setSocketTimeout(1000);
}
this.sslEngine.closeOutbound();
- updateEventMask();
+ try {
+ updateEventMask();
+ } catch (CancelledKeyException ex) {
+ shutdown();
+ }
}
@Override
@@ -625,14 +630,14 @@ public class SSLIOSession implements IOS
if (this.status == CLOSED) {
return;
}
+ this.status = CLOSED;
+ this.session.shutdown();
this.inEncrypted.release();
this.outEncrypted.release();
this.inPlain.release();
this.outPlain.release();
- this.status = CLOSED;
- this.session.shutdown();
}
@Override