diff options
| author | Robert Godfrey <rgodfrey@apache.org> | 2007-11-26 01:41:31 +0000 |
|---|---|---|
| committer | Robert Godfrey <rgodfrey@apache.org> | 2007-11-26 01:41:31 +0000 |
| commit | a1391b5724829e4268faf4de60625b2d05e86288 (patch) | |
| tree | d124245b02b8ead3be3e37cef3fbac684c606e4e /java/common/src | |
| parent | 66f97f32c78e0cf5914a441ae8277ee3aa659ce9 (diff) | |
| download | qpid-python-a1391b5724829e4268faf4de60625b2d05e86288.tar.gz | |
QPID-567 : Add mutliversion support to Qpid/Java, fixed client support when server returns Protocol header.
Added QueueUnbind
Added ability to select protocol version in ConnectionURL or with -Dorg.apache.qpid.amqp_version
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/branches/M2.1@598105 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/common/src')
| -rw-r--r-- | java/common/src/main/java/org/apache/qpid/codec/AMQDecoder.java | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/java/common/src/main/java/org/apache/qpid/codec/AMQDecoder.java b/java/common/src/main/java/org/apache/qpid/codec/AMQDecoder.java index 02ae3cb089..ff0bc798da 100644 --- a/java/common/src/main/java/org/apache/qpid/codec/AMQDecoder.java +++ b/java/common/src/main/java/org/apache/qpid/codec/AMQDecoder.java @@ -56,6 +56,7 @@ public class AMQDecoder extends CumulativeProtocolDecoder /** Flag to indicate whether this decoder needs to handle protocol initiation. */ private boolean _expectProtocolInitiation; + private boolean firstDecode = true; /** * Creates a new AMQP decoder. @@ -81,14 +82,24 @@ public class AMQDecoder extends CumulativeProtocolDecoder */ protected boolean doDecode(IoSession session, ByteBuffer in, ProtocolDecoderOutput out) throws Exception { - if (_expectProtocolInitiation) + + boolean decoded; + if (_expectProtocolInitiation + || (firstDecode + && (in.remaining() > 0) + && (in.get(in.position()) == (byte)'A'))) { - return doDecodePI(session, in, out); + decoded = doDecodePI(session, in, out); } else { - return doDecodeDataBlock(session, in, out); + decoded = doDecodeDataBlock(session, in, out); + } + if(firstDecode && decoded) + { + firstDecode = false; } + return decoded; } /** |
