If the key is null, channel is closed,not sure this is the correct fix, since the...
authorfhanik <fhanik@13f79535-47bb-0310-9956-ffa450edef68>
Mon, 30 Oct 2006 15:53:19 +0000 (15:53 +0000)
committerfhanik <fhanik@13f79535-47bb-0310-9956-ffa450edef68>
Mon, 30 Oct 2006 15:53:19 +0000 (15:53 +0000)
git-svn-id: https://svn.apache.org/repos/asf/tomcat/tc6.0.x/trunk@469168 13f79535-47bb-0310-9956-ffa450edef68

java/org/apache/tomcat/util/net/NioEndpoint.java

index 4c7a4a5..efc75e8 100644 (file)
@@ -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);