Only test for timeouts if timeout is greater than zero (aligns with BIO and APR)
authormarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Mon, 18 Jul 2011 15:10:29 +0000 (15:10 +0000)
committermarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Mon, 18 Jul 2011 15:10:29 +0000 (15:10 +0000)
git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1147921 13f79535-47bb-0310-9956-ffa450edef68

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

index 8cd7c06..388c894 100644 (file)
@@ -1339,7 +1339,10 @@ public class NioEndpoint extends AbstractEndpoint {
                         //only timeout sockets that we are waiting for a read from
                         long delta = now - ka.getLastAccess();
                         long timeout = (ka.getTimeout()==-1)?((long) socketProperties.getSoTimeout()):(ka.getTimeout());
-                        boolean isTimedout = delta > timeout;
+                        boolean isTimedout = false;
+                        if (timeout > 0) {
+                             isTimedout = delta > timeout;
+                        }
                         if ( close ) {
                             key.interestOps(0); 
                             ka.interestOps(0); //avoid duplicate stop calls