You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ch...@apache.org on 2006/05/23 00:43:36 UTC

svn commit: r408776 - /incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/OpenWireFormat.java

Author: chirino
Date: Mon May 22 15:43:35 2006
New Revision: 408776

URL: http://svn.apache.org/viewvc?rev=408776&view=rev
Log:
Applied patch at https://issues.apache.org/activemq/browse/AMQ-718

Modified:
    incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/OpenWireFormat.java

Modified: incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/OpenWireFormat.java
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/OpenWireFormat.java?rev=408776&r1=408775&r2=408776&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/OpenWireFormat.java (original)
+++ incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/openwire/OpenWireFormat.java Mon May 22 15:43:35 2006
@@ -233,11 +233,15 @@
 	            BooleanStream bs = new BooleanStream();
 	            size += dsm.tightMarshal1(this, c, bs);
 	            size += bs.marshalledSize(); 
-	
-	            dataOut.writeInt(size);
+
+                if( !sizePrefixDisabled ) {
+                    dataOut.writeInt(size);
+                }
+                
 	            dataOut.writeByte(type);            
 	            bs.marshal(dataOut);
 	            dsm.tightMarshal2(this, c, dataOut, bs);
+                
             } else {            	
             	DataOutputStream looseOut = dataOut;
             	ByteArrayOutputStream baos=null;
@@ -253,7 +257,7 @@
                 if( !sizePrefixDisabled ) {
                     looseOut.close();
                     ByteSequence sequence = baos.toByteSequence();
-                    dataOut.writeInt(sequence.getLength()-4);
+                    dataOut.writeInt(sequence.getLength());
                     dataOut.write(sequence.getData(), sequence.getOffset(), sequence.getLength());
                 }