diff options
author | Kim van der Riet <kpvdr@apache.org> | 2009-12-15 20:07:25 +0000 |
---|---|---|
committer | Kim van der Riet <kpvdr@apache.org> | 2009-12-15 20:07:25 +0000 |
commit | 50b1c4c74692abbbb954b4eb39504dd3d3a964ad (patch) | |
tree | bf721cd64f2ba0e7e215964366252c44f35fdc62 /cpp | |
parent | faf8a3a3a9f2355ec7044144d63ef869788eebb3 (diff) | |
download | qpid-python-50b1c4c74692abbbb954b4eb39504dd3d3a964ad.tar.gz |
Fix for QPID-2278 - "Store recovery compatibility problem introduced by alternate-exchange fix"
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@890965 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp')
-rw-r--r-- | cpp/src/qpid/broker/Exchange.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/cpp/src/qpid/broker/Exchange.cpp b/cpp/src/qpid/broker/Exchange.cpp index 4ebe126969..8efb9ac545 100644 --- a/cpp/src/qpid/broker/Exchange.cpp +++ b/cpp/src/qpid/broker/Exchange.cpp @@ -209,8 +209,10 @@ Exchange::shared_ptr Exchange::decode(ExchangeRegistry& exchanges, Buffer& buffe buffer.getShortString(name); bool durable(buffer.getOctet()); buffer.getShortString(type); - buffer.getShortString(altName); buffer.get(args); + // For backwards compatibility on restoring exchanges from before the alt-exchange update, perform check + if (buffer.available()) + buffer.getShortString(altName); try { Exchange::shared_ptr exch = exchanges.declare(name, type, durable, args).first; @@ -228,10 +230,10 @@ void Exchange::encode(Buffer& buffer) const buffer.putShortString(name); buffer.putOctet(durable); buffer.putShortString(getType()); - buffer.putShortString(alternate.get() ? alternate->getName() : string("")); if (args.isSet(qpidSequenceCounter)) args.setInt64(std::string(qpidSequenceCounter),sequenceNo); buffer.put(args); + buffer.putShortString(alternate.get() ? alternate->getName() : string("")); } uint32_t Exchange::encodedSize() const |