tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1103923 - /tomcat/trunk/java/org/apache/tomcat/util/net/NioBlockingSelector.java
Date Mon, 16 May 2011 22:02:04 GMT
Author: markt
Date: Mon May 16 22:02:04 2011
New Revision: 1103923

URL: http://svn.apache.org/viewvc?rev=1103923&view=rev
Log:
Add Filip's additional patch to correctly handle infinite read timeouts

Modified:
    tomcat/trunk/java/org/apache/tomcat/util/net/NioBlockingSelector.java

Modified: tomcat/trunk/java/org/apache/tomcat/util/net/NioBlockingSelector.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/net/NioBlockingSelector.java?rev=1103923&r1=1103922&r2=1103923&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/net/NioBlockingSelector.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/net/NioBlockingSelector.java Mon May 16 22:02:04
2011
@@ -166,7 +166,11 @@ public class NioBlockingSelector {
                 try {
                     if ( att.getReadLatch()==null || att.getReadLatch().getCount()==0) att.startReadLatch(1);
                     poller.add(att,SelectionKey.OP_READ, reference);
-                    att.awaitReadLatch(readTimeout,TimeUnit.MILLISECONDS);
+                    if (readTimeout < 0) {
+                        att.awaitReadLatch(Long.MAX_VALUE, TimeUnit.MILLISECONDS);
+                    } else {
+                        att.awaitReadLatch(readTimeout, TimeUnit.MILLISECONDS);
+                    }
                 }catch (InterruptedException ignore) {
                     Thread.interrupted();
                 }



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message