From: fhanik Date: Mon, 30 Oct 2006 15:53:19 +0000 (+0000) Subject: If the key is null, channel is closed,not sure this is the correct fix, since the... X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=404626b18ca7e8ba9228202824806adbc963d8e5;p=tomcat7.0 If the key is null, channel is closed,not sure this is the correct fix, since the key potentially had an attachment this could lead to NIO mem leak, must track down how this happens git-svn-id: https://svn.apache.org/repos/asf/tomcat/tc6.0.x/trunk@469168 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/java/org/apache/tomcat/util/net/NioEndpoint.java b/java/org/apache/tomcat/util/net/NioEndpoint.java index 4c7a4a581..efc75e85a 100644 --- a/java/org/apache/tomcat/util/net/NioEndpoint.java +++ b/java/org/apache/tomcat/util/net/NioEndpoint.java @@ -1432,13 +1432,11 @@ public class NioEndpoint { } } else { - NioChannel socket = (NioChannel)channel; - SelectionKey key = socket.getIOChannel().keyFor(socket.getPoller().getSelector()); int handshake = -1; try { - handshake = socket.handshake(key.isReadable(), key.isWritable()); + handshake = key!=null?socket.handshake(key.isReadable(), key.isWritable()):-1; }catch ( IOException x ) { handshake = -1; if ( log.isDebugEnabled() ) log.debug("Error during SSL handshake",x);