From: fhanik Date: Mon, 30 Oct 2006 16:15:35 +0000 (+0000) Subject: Revert fix, suggestion was incorrect and can lead to memory leaks X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=01ada0b90313cb61d53ffcf40099198bc8973b48;p=tomcat7.0 Revert fix, suggestion was incorrect and can lead to memory leaks git-svn-id: https://svn.apache.org/repos/asf/tomcat/tc6.0.x/trunk@469178 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 efc75e85a..e55038857 100644 --- a/java/org/apache/tomcat/util/net/NioEndpoint.java +++ b/java/org/apache/tomcat/util/net/NioEndpoint.java @@ -1432,11 +1432,13 @@ public class NioEndpoint { } } else { + NioChannel socket = (NioChannel)channel; + SelectionKey key = socket.getIOChannel().keyFor(socket.getPoller().getSelector()); int handshake = -1; try { - handshake = key!=null?socket.handshake(key.isReadable(), key.isWritable()):-1; + handshake = socket.handshake(key.isReadable(), key.isWritable()); }catch ( IOException x ) { handshake = -1; if ( log.isDebugEnabled() ) log.debug("Error during SSL handshake",x); @@ -1469,7 +1471,7 @@ public class NioEndpoint { } } } else if (handshake == -1 ) { - if ( key.isValid() ) key.cancel(); + socket.getPoller().cancelledKey(key,SocketStatus.DISCONNECT); try {socket.close(true);}catch (IOException ignore){} nioChannels.offer(socket); } else {