tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fha...@apache.org
Subject svn commit: r469178 - /tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java
Date Mon, 30 Oct 2006 16:15:36 GMT
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


Mime
View raw message