summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/broker/amqp/NodeProperties.cpp
diff options
context:
space:
mode:
authorGordon Sim <gsim@apache.org>2013-12-03 17:52:57 +0000
committerGordon Sim <gsim@apache.org>2013-12-03 17:52:57 +0000
commitf67a2180b370d8c3ee4b4d2f7b824fdf44c203ea (patch)
treed6b183a4c397f757828812bd8afa131ff077fbf6 /cpp/src/qpid/broker/amqp/NodeProperties.cpp
parentb21533559c33e0a36a5c3d42a17a61f43e43f141 (diff)
downloadqpid-python-f67a2180b370d8c3ee4b4d2f7b824fdf44c203ea.tar.gz
QPID-5384: special asserting logic for autodelete
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1547496 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/broker/amqp/NodeProperties.cpp')
-rw-r--r--cpp/src/qpid/broker/amqp/NodeProperties.cpp19
1 files changed, 13 insertions, 6 deletions
diff --git a/cpp/src/qpid/broker/amqp/NodeProperties.cpp b/cpp/src/qpid/broker/amqp/NodeProperties.cpp
index 40e970c2f6..586ff6d439 100644
--- a/cpp/src/qpid/broker/amqp/NodeProperties.cpp
+++ b/cpp/src/qpid/broker/amqp/NodeProperties.cpp
@@ -110,6 +110,12 @@ void NodeProperties::read(pn_data_t* data)
{
DataReader reader(*this);
reader.read(data);
+
+}
+
+bool NodeProperties::wasSpecified(const std::string& key)
+{
+ return specified.find(key) != specified.end();
}
void NodeProperties::write(pn_data_t* data, boost::shared_ptr<Queue> node)
@@ -120,7 +126,7 @@ void NodeProperties::write(pn_data_t* data, boost::shared_ptr<Queue> node)
pn_data_put_symbol(data, convert(SUPPORTED_DIST_MODES));
pn_data_put_string(data, convert(MOVE));//TODO: should really add COPY as well, since queues can be browsed
pn_bytes_t symbol;
- if (autoDelete && node->isAutoDelete() && getLifetimeDescriptorSymbol(node->getSettings().lifetime, symbol)) {
+ if (wasSpecified(AUTO_DELETE) && node->isAutoDelete() && getLifetimeDescriptorSymbol(node->getSettings().lifetime, symbol)) {
pn_data_put_symbol(data, convert(LIFETIME_POLICY));
pn_data_put_described(data);
pn_data_enter(data);
@@ -128,11 +134,11 @@ void NodeProperties::write(pn_data_t* data, boost::shared_ptr<Queue> node)
pn_data_put_list(data);
pn_data_exit(data);
}
- if (durable && node->isDurable()) {
+ if (wasSpecified(DURABLE) && node->isDurable()) {
pn_data_put_symbol(data, convert(DURABLE));
pn_data_put_bool(data, true);
}
- if (exclusive && node->hasExclusiveOwner()) {
+ if (wasSpecified(EXCLUSIVE) && node->hasExclusiveOwner()) {
pn_data_put_symbol(data, convert(EXCLUSIVE));
pn_data_put_bool(data, true);
}
@@ -170,7 +176,7 @@ void NodeProperties::write(pn_data_t* data, boost::shared_ptr<Exchange> node)
pn_data_enter(data);
pn_data_put_symbol(data, convert(SUPPORTED_DIST_MODES));
pn_data_put_string(data, convert(COPY));
- if (durable && node->isDurable()) {
+ if (wasSpecified(DURABLE) && node->isDurable()) {
pn_data_put_symbol(data, convert(DURABLE));
pn_data_put_bool(data, true);
}
@@ -182,9 +188,9 @@ void NodeProperties::write(pn_data_t* data, boost::shared_ptr<Exchange> node)
pn_data_put_symbol(data, convert(ALTERNATE_EXCHANGE));
pn_data_put_string(data, convert(node->getAlternate()->getName()));
}
- if (autoDelete) {
+ if (wasSpecified(AUTO_DELETE)) {
pn_data_put_symbol(data, convert(AUTO_DELETE));
- pn_data_put_bool(data, autoDelete);
+ pn_data_put_bool(data, node->isAutoDelete());
}
for (qpid::types::Variant::Map::const_iterator i = properties.begin(); i != properties.end(); ++i) {
@@ -203,6 +209,7 @@ void NodeProperties::process(const std::string& key, const qpid::types::Variant&
{
received = true;
QPID_LOG(debug, "Processing node property " << key << " = " << value);
+ specified.insert(key);
if (key == SUPPORTED_DIST_MODES) {
if (value == MOVE) queue = true;
else if (value == COPY) queue = false;