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 504445c  Tweak the debug logging so the content of all header packets 
are dumped
504445c is described below

commit 504445cd2c618fb1edbfeda62e07e1c29b4d285c
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Wed Sep 2 12:08:43 2020 +0100

    Tweak the debug logging so the content of all header packets are dumped
---
 java/org/apache/coyote/http11/Http11InputBuffer.java | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/java/org/apache/coyote/http11/Http11InputBuffer.java 
b/java/org/apache/coyote/http11/Http11InputBuffer.java
index 2d8b69f..f5538af 100644
--- a/java/org/apache/coyote/http11/Http11InputBuffer.java
+++ b/java/org/apache/coyote/http11/Http11InputBuffer.java
@@ -385,10 +385,6 @@ public class Http11InputBuffer implements InputBuffer, 
ApplicationBufferHandler
 
             parsingRequestLineStart = byteBuffer.position();
             parsingRequestLinePhase = 2;
-            if (log.isDebugEnabled()) {
-                log.debug("Received ["
-                        + new String(byteBuffer.array(), 
byteBuffer.position(), byteBuffer.remaining(), StandardCharsets.ISO_8859_1) + 
"]");
-            }
         }
         if (parsingRequestLinePhase == 2) {
             //
@@ -765,7 +761,7 @@ public class Http11InputBuffer implements InputBuffer, 
ApplicationBufferHandler
     private boolean fill(boolean block) throws IOException {
 
         if (log.isDebugEnabled()) {
-            log.debug("parsingHeader: [" + parsingHeader +
+            log.debug("Before fill(): [" + parsingHeader +
                     "], parsingRequestLine: [" + parsingRequestLine +
                     "], parsingRequestLinePhase: [" + parsingRequestLinePhase +
                     "], parsingRequestLineStart: [" + parsingRequestLineStart +
@@ -797,6 +793,12 @@ public class Http11InputBuffer implements InputBuffer, 
ApplicationBufferHandler
             throw new CloseNowException(sm.getString("iib.eof.error"));
         }
         byteBuffer.limit(byteBuffer.position()).reset();
+
+        if (log.isDebugEnabled()) {
+            log.debug("Received ["
+                    + new String(byteBuffer.array(), byteBuffer.position(), 
byteBuffer.remaining(), StandardCharsets.ISO_8859_1) + "]");
+        }
+
         if (nRead > 0) {
             return true;
         } else if (nRead == -1) {


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

Reply via email to