tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1652382 - /tomcat/trunk/java/org/apache/tomcat/util/net/Nio2Endpoint.java
Date Fri, 16 Jan 2015 10:53:12 GMT
Author: markt
Date: Fri Jan 16 10:53:12 2015
New Revision: 1652382

URL: http://svn.apache.org/r1652382
Log:
Minor optimisation.

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

Modified: tomcat/trunk/java/org/apache/tomcat/util/net/Nio2Endpoint.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/net/Nio2Endpoint.java?rev=1652382&r1=1652381&r2=1652382&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/net/Nio2Endpoint.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/net/Nio2Endpoint.java Fri Jan 16 10:53:12 2015
@@ -1171,12 +1171,12 @@ public class Nio2Endpoint extends Abstra
         protected void doWrite(boolean block) throws IOException {
             try {
                 socketBufferHandler.configureWriteBufferForRead();
-                while (socketBufferHandler.getWriteBuffer().hasRemaining()) {
+                do {
                     if (getSocket().write(socketBufferHandler.getWriteBuffer()).get(getTimeout(),
                             TimeUnit.MILLISECONDS).intValue() < 0) {
                         throw new EOFException(sm.getString("iob.failedwrite"));
                     }
-                }
+                } while (socketBufferHandler.getWriteBuffer().hasRemaining());
             } catch (ExecutionException e) {
                 if (e.getCause() instanceof IOException) {
                     throw (IOException) e.getCause();



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


Mime
View raw message