Revert r1160772 & r1160774.
authormarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Thu, 25 Aug 2011 12:30:22 +0000 (12:30 +0000)
committermarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Thu, 25 Aug 2011 12:30:22 +0000 (12:30 +0000)
These changes turned out to be unnecessary.

git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1161540 13f79535-47bb-0310-9956-ffa450edef68

java/org/apache/coyote/ajp/AbstractAjpProcessor.java

index bc2e58a..39fb0b6 100644 (file)
@@ -225,12 +225,6 @@ public abstract class AbstractAjpProcessor<S> extends AbstractProcessor<S> {
     protected long bytesWritten = 0;
 
 
-    /**
-     * Request body bytes read for the current request.
-     */
-    protected long bodyBytesRead = 0;
-
-
     // ------------------------------------------------------------ Constructor
 
     public AbstractAjpProcessor(int packetSize, AbstractEndpoint endpoint) {
@@ -536,7 +530,6 @@ public abstract class AbstractAjpProcessor<S> extends AbstractProcessor<S> {
         response.recycle();
         certificates.recycle();
         bytesWritten = 0;
-        bodyBytesRead = 0;
     }
 
 
@@ -1010,9 +1003,9 @@ public abstract class AbstractAjpProcessor<S> extends AbstractProcessor<S> {
      */
     protected class SocketInputBuffer implements InputBuffer {
 
+
         /**
-         * Read bytes into the specified chunk. If no chunk is specified, the
-         * bytes are swallowed.
+         * Read bytes into the specified chunk.
          */
         @Override
         public int doRead(ByteChunk chunk, Request req)
@@ -1032,12 +1025,10 @@ public abstract class AbstractAjpProcessor<S> extends AbstractProcessor<S> {
                 }
             }
             ByteChunk bc = bodyBytes.getByteChunk();
-            bodyBytesRead += bc.getLength();
-            if (chunk != null) {
-                chunk.setBytes(bc.getBuffer(), bc.getStart(), bc.getLength());
-            }
+            chunk.setBytes(bc.getBuffer(), bc.getStart(), bc.getLength());
             empty = true;
-            return bc.getLength();
+            return chunk.getLength();
+
         }
 
     }