[tomcat] branch 10.0.x updated: Improve comments. Remove unnecessary code.

2022-03-08 Thread markt
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/10.0.x by this push:
 new 0bd0f93  Improve comments. Remove unnecessary code.
0bd0f93 is described below

commit 0bd0f938a25e9a1950b0b73e5a19f66395313f69
Author: Mark Thomas 
AuthorDate: Tue Mar 8 15:51:42 2022 +

Improve comments. Remove unnecessary code.
---
 java/org/apache/coyote/http11/Http11InputBuffer.java | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/java/org/apache/coyote/http11/Http11InputBuffer.java 
b/java/org/apache/coyote/http11/Http11InputBuffer.java
index fd9d18d..6757e69 100644
--- a/java/org/apache/coyote/http11/Http11InputBuffer.java
+++ b/java/org/apache/coyote/http11/Http11InputBuffer.java
@@ -845,8 +845,9 @@ public class Http11InputBuffer implements InputBuffer, 
ApplicationBufferHandler
 /**
  * Parse an HTTP header.
  *
- * @return false after reading a blank line (which indicates that the
- * HTTP header parsing is done
+ * @return One of {@link HeaderParseStatus#NEED_MORE_DATA},
+ * {@link HeaderParseStatus#HAVE_MORE_HEADERS} or
+ * {@link HeaderParseStatus#DONE}.
  */
 private HeaderParseStatus parseHeader() throws IOException {
 
@@ -854,8 +855,7 @@ public class Http11InputBuffer implements InputBuffer, 
ApplicationBufferHandler
 
 // Read new bytes if needed
 if (byteBuffer.position() >= byteBuffer.limit()) {
-if (!fill(false)) {// parse header
-headerParsePos = HeaderParsePosition.HEADER_START;
+if (!fill(false)) {
 return HeaderParseStatus.NEED_MORE_DATA;
 }
 }

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



[tomcat] branch 10.0.x updated: Improve comments

2021-07-15 Thread markt
This is an automated email from the ASF dual-hosted git repository.

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


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

commit 590d65e24a6f987ae57d8c8ab83949c6baaef263
Author: Mark Thomas 
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 c07fd07..42ddfcb 100644
--- a/java/org/apache/tomcat/util/net/NioEndpoint.java
+++ b/java/org/apache/tomcat/util/net/NioEndpoint.java
@@ -1313,7 +1313,7 @@ public class NioEndpoint extends 
AbstractJsseEndpoint
  * 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.
@@ -1361,10 +1361,6 @@ public class NioEndpoint extends 
AbstractJsseEndpoint
 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);
@@ -1372,6 +1368,10 @@ public class NioEndpoint extends 
AbstractJsseEndpoint
 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