This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch 9.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/9.0.x by this push:
     new 89e4b2a  Improve comments
89e4b2a is described below

commit 89e4b2af74df6a365e96c39acc59c8e63fc14334
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Thu Jul 15 16:59:51 2021 +0100

    Improve comments
---
 java/org/apache/tomcat/util/net/NioEndpoint.java      | 10 +++++-----
 java/org/apache/tomcat/util/net/SecureNioChannel.java |  2 --
 2 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/java/org/apache/tomcat/util/net/NioEndpoint.java 
b/java/org/apache/tomcat/util/net/NioEndpoint.java
index 234747c..d4559bc 100644
--- a/java/org/apache/tomcat/util/net/NioEndpoint.java
+++ b/java/org/apache/tomcat/util/net/NioEndpoint.java
@@ -1340,7 +1340,7 @@ public class NioEndpoint extends 
AbstractJsseEndpoint<NioChannel,SocketChannel>
                      * write it as part of a subsequent write call.
                      *
                      * Because of the above, when a timeout is triggered we 
need
-                     * so skip subsequent attempts to write as otherwise it 
will
+                     * to skip subsequent attempts to write as otherwise it 
will
                      * appear to the client as if some data was dropped just
                      * before the connection is lost. It is better if the 
client
                      * just sees the dropped connection.
@@ -1388,10 +1388,6 @@ public class NioEndpoint extends 
AbstractJsseEndpoint<NioChannel,SocketChannel>
                         startNanos = 0;
                     }
                 } while (buffer.hasRemaining());
-                // If there is data left in the buffer the socket will be 
registered for
-                // write further up the stack. This is to ensure the socket is 
only
-                // registered for write once as both container and user code 
can trigger
-                // write registration.
             } else {
                 do {
                     n = getSocket().write(buffer);
@@ -1399,6 +1395,10 @@ public class NioEndpoint extends 
AbstractJsseEndpoint<NioChannel,SocketChannel>
                         throw new EOFException();
                     }
                 } while (n > 0 && buffer.hasRemaining());
+                // If there is data left in the buffer the socket will be 
registered for
+                // write further up the stack. This is to ensure the socket is 
only
+                // registered for write once as both container and user code 
can trigger
+                // write registration.
             }
             updateLastWrite();
         }
diff --git a/java/org/apache/tomcat/util/net/SecureNioChannel.java 
b/java/org/apache/tomcat/util/net/SecureNioChannel.java
index de47904..63af010 100644
--- a/java/org/apache/tomcat/util/net/SecureNioChannel.java
+++ b/java/org/apache/tomcat/util/net/SecureNioChannel.java
@@ -788,8 +788,6 @@ public class SecureNioChannel extends NioChannel {
     public int write(ByteBuffer src) throws IOException {
         checkInterruptStatus();
         if (src == this.netOutBuffer) {
-            //we can get here through a recursive call
-            //by using the NioBlockingSelector
             int written = sc.write(src);
             return written;
         } else {

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

Reply via email to