Issue Details (XML | Word | Printable)

Key: AMQ-718
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Hiram Chirino
Reporter: Andrew Lusk
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
ActiveMQ

Incorrect length specification in loose encoding?

Created: 22/May/06 06:06 AM   Updated: 30/May/06 06:37 PM
Return to search
Component/s: Transport
Affects Version/s: 4.0 RC2, 4.0 RC3, 4.0
Fix Version/s: 4.0

Time Tracking:
Not Specified


 Description  « Hide
Unless loose-encoded length is mean to mean something different from tight-encoded length, I believe that the length written to the wire for loosely-encoded OpenWire messages is off by 4. I imagine this hasn't been caught before because most clients synchronously read packets off the wire and so can ignore the length specification.

— activemq-core/src/main/java/org/apache/activemq/openwire/OpenWireFormat.java (revision 399408)
+++ activemq-core/src/main/java/org/apache/activemq/openwire/OpenWireFormat.java (working copy)
@@ -172,7 +172,7 @@
sequence = baos.toByteSequence();

if( !sizePrefixDisabled ) { - size = sequence.getLength()-4; + size = sequence.getLength(); ByteArrayPacket packet = new ByteArrayPacket(sequence); PacketData.writeIntBig(packet, size); }
@@ -253,7 +253,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()); }



 All   Comments   Work Log   Change History   Subversion Commits   FishEye   Crucible      Sort Order: Ascending order - Click to sort in descending order
No related commits found.