tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1297979 - /tomcat/trunk/java/org/apache/tomcat/util/net/NioBlockingSelector.java
Date Wed, 07 Mar 2012 14:35:00 GMT
Author: markt
Date: Wed Mar  7 14:34:59 2012
New Revision: 1297979

URL: http://svn.apache.org/viewvc?rev=1297979&view=rev
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=52770
Fixes very rarely (if ever) used infinite timeouts on write

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=1297979&r1=1297978&r2=1297979&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/net/NioBlockingSelector.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/net/NioBlockingSelector.java Wed Mar  7 14:34:59
2012
@@ -103,7 +103,11 @@ public class NioBlockingSelector {
                 try {
                     if ( att.getWriteLatch()==null || att.getWriteLatch().getCount()==0)
att.startWriteLatch(1);
                     poller.add(att,SelectionKey.OP_WRITE,reference);
-                    att.awaitWriteLatch(writeTimeout,TimeUnit.MILLISECONDS);
+                    if (writeTimeout < 0) {
+                        att.awaitWriteLatch(Long.MAX_VALUE,TimeUnit.MILLISECONDS);
+                    } else {
+                        att.awaitWriteLatch(writeTimeout,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