- Adjust content length fix so that it does the same as for the HTTP connector.
authorremm <remm@13f79535-47bb-0310-9956-ffa450edef68>
Mon, 28 Aug 2006 09:26:51 +0000 (09:26 +0000)
committerremm <remm@13f79535-47bb-0310-9956-ffa450edef68>
Mon, 28 Aug 2006 09:26:51 +0000 (09:26 +0000)
git-svn-id: https://svn.apache.org/repos/asf/tomcat/tc6.0.x/trunk@437620 13f79535-47bb-0310-9956-ffa450edef68

java/org/apache/coyote/ajp/AjpAprProcessor.java
java/org/apache/coyote/ajp/AjpProcessor.java
java/org/apache/jk/core/MsgContext.java

index 41d948b..2a978d6 100644 (file)
@@ -571,9 +571,9 @@ public class AjpAprProcessor implements ActionHook {
         } else if (actionCode == ActionCode.ACTION_REQ_SET_BODY_REPLAY) {
 
             // Set the given bytes as the content
-            request.setContentLength(-1); // reset content length
             ByteChunk bc = (ByteChunk) param;
             bodyBytes.setBytes(bc.getBytes(), bc.getStart(), bc.getLength());
+            request.setContentLength(bc.getLength());
             first = false;
             empty = false;
             replay = true;
index faf8507..6e09d0f 100644 (file)
@@ -543,6 +543,7 @@ public class AjpProcessor implements ActionHook {
             // Set the given bytes as the content
             ByteChunk bc = (ByteChunk) param;
             bodyBytes.setBytes(bc.getBytes(), bc.getStart(), bc.getLength());
+            request.setContentLength(bc.getLength());
             first = false;
             empty = false;
             replay = true;
index e9d10d9..da2eaae 100644 (file)
@@ -351,8 +351,8 @@ public class MsgContext implements ActionHook {
         } else if ( actionCode == ActionCode.ACTION_REQ_SET_BODY_REPLAY ) {
             if( log.isTraceEnabled() )
                 log.trace("Replay ");
-            req.setContentLength(-1); // reset content length
             ByteChunk bc = (ByteChunk)param;
+            req.setContentLength(bc.getLength());
             jkIS.setReplay(bc);
         }
     }