diff options
author | Gordon Sim <gsim@apache.org> | 2009-12-16 11:28:58 +0000 |
---|---|---|
committer | Gordon Sim <gsim@apache.org> | 2009-12-16 11:28:58 +0000 |
commit | 8244ed2f1c6edb95e27112e3831476a386fa57dc (patch) | |
tree | d2efb5ee30250927025fe4b2ddb5e0b48be4ec73 /cpp/src | |
parent | 3e14068a726098d299ea07918f3910438093b3c2 (diff) | |
download | qpid-python-8244ed2f1c6edb95e27112e3831476a386fa57dc.tar.gz |
QPID-2278: Encode alternate exchange information at the end of the buffer for backward compatibility with stores created from older versions
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@891195 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src')
-rw-r--r-- | cpp/src/qpid/broker/Queue.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/cpp/src/qpid/broker/Queue.cpp b/cpp/src/qpid/broker/Queue.cpp index ef1adaf7ec..f4231f2397 100644 --- a/cpp/src/qpid/broker/Queue.cpp +++ b/cpp/src/qpid/broker/Queue.cpp @@ -940,11 +940,11 @@ void Queue::setPersistenceId(uint64_t _persistenceId) const void Queue::encode(Buffer& buffer) const { buffer.putShortString(name); - buffer.putShortString(alternateExchange.get() ? alternateExchange->getName() : std::string("")); buffer.put(settings); if (policy.get()) { buffer.put(*policy); } + buffer.putShortString(alternateExchange.get() ? alternateExchange->getName() : std::string("")); } uint32_t Queue::encodedSize() const @@ -959,15 +959,17 @@ Queue::shared_ptr Queue::decode ( QueueRegistry& queues, Buffer& buffer, bool re { string name; buffer.getShortString(name); - string altExch; - buffer.getShortString(altExch); std::pair<Queue::shared_ptr, bool> result = queues.declare(name, true); - result.first->alternateExchangeName.assign(altExch); buffer.get(result.first->settings); result.first->configure(result.first->settings, recovering ); if (result.first->policy.get() && buffer.available() >= result.first->policy->encodedSize()) { buffer.get ( *(result.first->policy) ); } + if (buffer.available()) { + string altExch; + buffer.getShortString(altExch); + result.first->alternateExchangeName.assign(altExch); + } return result.first; } |