summaryrefslogtreecommitdiff
path: root/qpid/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
commit4cb1c9db75563639e145707678bad7f829921ca4 (patch)
treec008c50e28d4e21fa7957f98bf66c9bef3ddffaa /qpid/cpp/src
parent6ef9706fc3d447768b4d0d2b0cee8bea828677bd (diff)
downloadqpid-python-4cb1c9db75563639e145707678bad7f829921ca4.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@890965 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/src')
-rw-r--r--qpid/cpp/src/qpid/broker/Exchange.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/qpid/cpp/src/qpid/broker/Exchange.cpp b/qpid/cpp/src/qpid/broker/Exchange.cpp
index 4ebe126969..8efb9ac545 100644
--- a/qpid/cpp/src/qpid/broker/Exchange.cpp
+++ b/qpid/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