Author: markt Date: Wed Jun 6 15:31:14 2012 New Revision: 1346947 URL: http://svn.apache.org/viewvc?rev=1346947&view=rev Log: Fix (hopefully) persistent failure of Comet unit test for connector stop when the END event is not received
Modified: tomcat/tc7.0.x/trunk/ (props changed) tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml Propchange: tomcat/tc7.0.x/trunk/ ------------------------------------------------------------------------------ Merged /tomcat/trunk:r1346932 Modified: tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java?rev=1346947&r1=1346946&r2=1346947&view=diff ============================================================================== --- tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java (original) +++ tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java Wed Jun 6 15:31:14 2012 @@ -1437,8 +1437,12 @@ public class NioEndpoint extends Abstrac cancelledKey(key, SocketStatus.TIMEOUT,true); } } else if (ka.isAsync() || ka.getComet()) { - // Async requests with a timeout of 0 or less never timeout - if (!ka.isAsync() || ka.getTimeout() > 0) { + if (close) { + key.interestOps(0); + ka.interestOps(0); //avoid duplicate stop calls + processKey(key,ka); + } else if (!ka.isAsync() || ka.getTimeout() > 0) { + // Async requests with a timeout of 0 or less never timeout long delta = now - ka.getLastAccess(); long timeout = (ka.getTimeout()==-1)?((long) socketProperties.getSoTimeout()):(ka.getTimeout()); boolean isTimedout = delta > timeout; Modified: tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml?rev=1346947&r1=1346946&r2=1346947&view=diff ============================================================================== --- tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml (original) +++ tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml Wed Jun 6 15:31:14 2012 @@ -266,6 +266,10 @@ via getter from the endpoint and as JMX attribute of the ThreadPool mbean. (rjung) </add> + <fix> + Correct an edge case where Comet END events were not send to connected + clients when the Tomcat connector was stopped. (markt) + </fix> </changelog> </subsection> <subsection name="Jasper"> --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org