mimic APR behavior and do stuff according to document, TIMEOUT should not close the...
authorfhanik <fhanik@13f79535-47bb-0310-9956-ffa450edef68>
Tue, 8 May 2007 11:00:06 +0000 (11:00 +0000)
committerfhanik <fhanik@13f79535-47bb-0310-9956-ffa450edef68>
Tue, 8 May 2007 11:00:06 +0000 (11:00 +0000)
git-svn-id: https://svn.apache.org/repos/asf/tomcat/tc6.0.x/trunk@536159 13f79535-47bb-0310-9956-ffa450edef68

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

index 2c1f956..2d62d3e 100644 (file)
@@ -1389,9 +1389,10 @@ public class NioEndpoint {
                     //processSocket(ka.getChannel(), status, dispatch);
                     ka.setComet(false);//to avoid a loop
                     processSocket(ka.getChannel(), status, false);//don't dispatch if the lines below are cancelling the key
+                    if (status == SocketStatus.TIMEOUT ) return; // don't close on comet timeout
                 }
                 if (key.isValid()) key.cancel();
-                if (key.channel().isOpen()) key.channel().close();
+                if (key.channel().isOpen()) try {key.channel().close();}catch (Exception ignore){}
                 try {ka.channel.close(true);}catch (Exception ignore){}
                 key.attach(null);
             } catch (Throwable e) {