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-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org