tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1160774 - /tomcat/trunk/java/org/apache/coyote/ajp/AbstractAjpProcessor.java
Date Tue, 23 Aug 2011 16:20:42 GMT
Author: markt
Date: Tue Aug 23 16:20:42 2011
New Revision: 1160774

URL: http://svn.apache.org/viewvc?rev=1160774&view=rev
Log:
Add ability to track bytes read

Modified:
    tomcat/trunk/java/org/apache/coyote/ajp/AbstractAjpProcessor.java

Modified: tomcat/trunk/java/org/apache/coyote/ajp/AbstractAjpProcessor.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/ajp/AbstractAjpProcessor.java?rev=1160774&r1=1160773&r2=1160774&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/ajp/AbstractAjpProcessor.java (original)
+++ tomcat/trunk/java/org/apache/coyote/ajp/AbstractAjpProcessor.java Tue Aug 23 16:20:42
2011
@@ -225,6 +225,12 @@ public abstract class AbstractAjpProcess
     protected long bytesWritten = 0;
 
 
+    /**
+     * Request body bytes read for the current request.
+     */
+    protected long bodyBytesRead = 0;
+
+
     // ------------------------------------------------------------ Constructor
 
     public AbstractAjpProcessor(int packetSize, AbstractEndpoint endpoint) {
@@ -530,6 +536,7 @@ public abstract class AbstractAjpProcess
         response.recycle();
         certificates.recycle();
         bytesWritten = 0;
+        bodyBytesRead = 0;
     }
 
 
@@ -1008,7 +1015,7 @@ public abstract class AbstractAjpProcess
          * Read bytes into the specified chunk.
          */
         @Override
-        public int doRead(ByteChunk chunk, Request req )
+        public int doRead(ByteChunk chunk, Request req)
         throws IOException {
 
             if (endOfStream) {
@@ -1025,10 +1032,10 @@ public abstract class AbstractAjpProcess
                 }
             }
             ByteChunk bc = bodyBytes.getByteChunk();
+            bodyBytesRead += bc.getLength();
             chunk.setBytes(bc.getBuffer(), bc.getStart(), bc.getLength());
             empty = true;
-            return chunk.getLength();
-
+            return bc.getLength();
         }
 
     }



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


Mime
View raw message