Make sure the connection always closes, no matter what
authorfhanik <fhanik@13f79535-47bb-0310-9956-ffa450edef68>
Mon, 19 Mar 2007 23:35:42 +0000 (23:35 +0000)
committerfhanik <fhanik@13f79535-47bb-0310-9956-ffa450edef68>
Mon, 19 Mar 2007 23:35:42 +0000 (23:35 +0000)
git-svn-id: https://svn.apache.org/repos/asf/tomcat/tc6.0.x/trunk@520176 13f79535-47bb-0310-9956-ffa450edef68

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

index e56df3f..dc71016 100644 (file)
@@ -1294,11 +1294,10 @@ public class NioEndpoint {
                 if (ka != null && ka.getComet()) {
                     //the comet event takes care of clean up
                     processSocket(ka.getChannel(), status, dispatch);
-                }else {
-                    if (key.isValid()) key.cancel();
-                    if (key.channel().isOpen()) key.channel().close();
-                    key.attach(null);
                 }
+                if (key.isValid()) key.cancel();
+                if (key.channel().isOpen()) key.channel().close();
+                key.attach(null);
             } catch (Throwable e) {
                 if ( log.isDebugEnabled() ) log.error("",e);
                 // Ignore