summaryrefslogtreecommitdiff
path: root/cpp/src
diff options
context:
space:
mode:
authorKim van der Riet <kpvdr@apache.org>2009-12-15 20:07:25 +0000
committerKim van der Riet <kpvdr@apache.org>2009-12-15 20:07:25 +0000
commit50b1c4c74692abbbb954b4eb39504dd3d3a964ad (patch)
treebf721cd64f2ba0e7e215964366252c44f35fdc62 /cpp/src
parentfaf8a3a3a9f2355ec7044144d63ef869788eebb3 (diff)
downloadqpid-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/src')
-rw-r--r--cpp/src/qpid/broker/Exchange.cpp6
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