Always reset the MB when doing getBytes
authorbillbarker <billbarker@13f79535-47bb-0310-9956-ffa450edef68>
Sun, 20 May 2007 22:28:47 +0000 (22:28 +0000)
committerbillbarker <billbarker@13f79535-47bb-0310-9956-ffa450edef68>
Sun, 20 May 2007 22:28:47 +0000 (22:28 +0000)
Fix for bug #36155

1) an unconditional reset is cheap if I'm going to call MB.setBytes
2) the JK connector doesn't support any charset except iso-latin-1 anyway
3) This particular connector is on the fast track to deprecated

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

java/org/apache/jk/common/MsgAjp.java

index f9fcf3c..dd602dc 100644 (file)
@@ -237,8 +237,8 @@ public class MsgAjp extends Msg {
 
     public void getBytes(MessageBytes mb) {
         int length = getInt();
+        mb.recycle();
         if( (length == 0xFFFF) || (length == -1) ) {
-            mb.recycle();
             return;
         }
         mb.setBytes( buf, pos, length );