tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1209278 - /tomcat/trunk/java/org/apache/tomcat/util/net/NioBlockingSelector.java
Date Thu, 01 Dec 2011 22:27:39 GMT
Author: markt
Date: Thu Dec  1 22:27:39 2011
New Revision: 1209278

URL: http://svn.apache.org/viewvc?rev=1209278&view=rev
Log:
Simplify

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=1209278&r1=1209277&r2=1209278&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/net/NioBlockingSelector.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/net/NioBlockingSelector.java Thu Dec  1 22:27:39
2011
@@ -154,13 +154,12 @@ public class NioBlockingSelector {
         int keycount = 1; //assume we can read
         long time = System.currentTimeMillis(); //start the timeout timer
         try {
-            while ( (!timedout) && read == 0) {
+            while(!timedout) {
                 if (keycount > 0) { //only read if we were registered for a read
-                    int cnt = socket.read(buf);
-                    if (cnt == -1)
+                    read = socket.read(buf);
+                    if (read == -1)
                         throw new EOFException();
-                    read += cnt;
-                    if (cnt > 0)
+                    if (read > 0)
                         break;
                 }
                 try {



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


Mime
View raw message