From 424ffb540905e90d0dfa9b886c6c74dfafe5639c Mon Sep 17 00:00:00 2001 From: fhanik Date: Tue, 8 May 2007 11:00:06 +0000 Subject: [PATCH] mimic APR behavior and do stuff according to document, TIMEOUT should not close the connection 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 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/java/org/apache/tomcat/util/net/NioEndpoint.java b/java/org/apache/tomcat/util/net/NioEndpoint.java index 2c1f956e2..2d62d3e33 100644 --- a/java/org/apache/tomcat/util/net/NioEndpoint.java +++ b/java/org/apache/tomcat/util/net/NioEndpoint.java @@ -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) { -- 2.11.0