Return-Path: Delivered-To: apmail-geronimo-activemq-dev-archive@www.apache.org Received: (qmail 59412 invoked from network); 22 May 2006 06:07:29 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 22 May 2006 06:07:29 -0000 Received: (qmail 62902 invoked by uid 500); 22 May 2006 06:07:29 -0000 Delivered-To: apmail-geronimo-activemq-dev-archive@geronimo.apache.org Received: (qmail 62799 invoked by uid 500); 22 May 2006 06:07:28 -0000 Mailing-List: contact activemq-dev-help@geronimo.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: activemq-dev@geronimo.apache.org Delivered-To: mailing list activemq-dev@geronimo.apache.org Received: (qmail 62790 invoked by uid 99); 22 May 2006 06:07:28 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 21 May 2006 23:07:28 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [209.237.227.198] (HELO brutus.apache.org) (209.237.227.198) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 21 May 2006 23:07:28 -0700 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 8137A7141F5 for ; Mon, 22 May 2006 06:06:51 +0000 (GMT) Message-ID: <27141948.1148278011495.JavaMail.jira@brutus> Date: Mon, 22 May 2006 06:06:51 +0000 (GMT+00:00) From: "Andrew Lusk (JIRA)" To: activemq-dev@geronimo.apache.org Subject: [jira] Created: (AMQ-718) Incorrect length specification in loose encoding? MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Incorrect length specification in loose encoding? ------------------------------------------------- Key: AMQ-718 URL: https://issues.apache.org/activemq/browse/AMQ-718 Project: ActiveMQ Type: Bug Components: Transport Reporter: Andrew Lusk 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()); } -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/activemq/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira