You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2015/01/08 14:10:00 UTC

svn commit: r1650270 - in /tomcat/trunk/java/org/apache/tomcat/util/net: AprEndpoint.java NioEndpoint.java

Author: markt
Date: Thu Jan  8 13:09:59 2015
New Revision: 1650270

URL: http://svn.apache.org/r1650270
Log:
Start to align write methods

Modified:
    tomcat/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java
    tomcat/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java

Modified: tomcat/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java?rev=1650270&r1=1650269&r2=1650270&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java Thu Jan  8 13:09:59 2015
@@ -2506,7 +2506,10 @@ public class AprEndpoint extends Abstrac
 
         @Override
         public void write(boolean block, byte[] b, int off, int len) throws IOException {
+            doWrite(block, b, off, len);
+        }
 
+        private void doWrite(boolean block, byte[] b, int off, int len) throws IOException {
             if (closed) {
                 throw new IOException(sm.getString("apr.closed", getSocket()));
             }

Modified: tomcat/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java?rev=1650270&r1=1650269&r2=1650270&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java Thu Jan  8 13:09:59 2015
@@ -1526,7 +1526,7 @@ public class NioEndpoint extends Abstrac
                 int thisTime = transfer(b, off, len, socketWriteBuffer);
                 len = len - thisTime;
                 off = off + thisTime;
-                int written = writeToSocket(socketWriteBuffer, block, true);
+                int written = doWrite(socketWriteBuffer, block, true);
                 if (written == 0) {
                     dataLeft = true;
                 } else {
@@ -1558,7 +1558,7 @@ public class NioEndpoint extends Abstrac
 
             //write to the socket, if there is anything to write
             if (dataLeft) {
-                writeToSocket(socketWriteBuffer, block, !writeBufferFlipped);
+                doWrite(socketWriteBuffer, block, !writeBufferFlipped);
             }
 
             dataLeft = hasMoreDataToFlush();
@@ -1573,7 +1573,7 @@ public class NioEndpoint extends Abstrac
                         if (buffer.getBuf().remaining() == 0) {
                             bufIter.remove();
                         }
-                        writeToSocket(socketWriteBuffer, block, true);
+                        doWrite(socketWriteBuffer, block, true);
                         //here we must break if we didn't finish the write
                     }
                 }
@@ -1594,7 +1594,7 @@ public class NioEndpoint extends Abstrac
         }
 
 
-        private synchronized int writeToSocket(ByteBuffer bytebuffer, boolean block, boolean flip) throws IOException {
+        private synchronized int doWrite(ByteBuffer bytebuffer, boolean block, boolean flip) throws IOException {
             if (flip) {
                 bytebuffer.flip();
                 writeBufferFlipped = true;



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