You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by fh...@apache.org on 2006/10/30 17:15:36 UTC

svn commit: r469178 - /tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java

Author: fhanik
Date: Mon Oct 30 08:15:35 2006
New Revision: 469178

URL: http://svn.apache.org/viewvc?view=rev&rev=469178
Log:
Revert fix, suggestion was incorrect and can lead to memory leaks

Modified:
    tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java

Modified: tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java
URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java?view=diff&rev=469178&r1=469177&r2=469178
==============================================================================
--- tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java (original)
+++ tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java Mon Oct 30 08:15:35 2006
@@ -1432,11 +1432,13 @@
                             
                         }
                     } 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 @@
                                 }
                             }
                         } 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 {



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org