summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/messaging/amqp/AddressHelper.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/messaging/amqp/AddressHelper.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/messaging/amqp/AddressHelper.cpp')
-rw-r--r--cpp/src/qpid/messaging/amqp/AddressHelper.cpp17
1 files changed, 14 insertions, 3 deletions
diff --git a/cpp/src/qpid/messaging/amqp/AddressHelper.cpp b/cpp/src/qpid/messaging/amqp/AddressHelper.cpp
index 5595d527f6..3dbacac11f 100644
--- a/cpp/src/qpid/messaging/amqp/AddressHelper.cpp
+++ b/cpp/src/qpid/messaging/amqp/AddressHelper.cpp
@@ -660,6 +660,7 @@ void AddressHelper::checkAssertion(pn_terminus_t* terminus, CheckMode mode)
//set. However this can be avoided by not specifying any node
//properties when asserting)
if (!type.empty() || durableNode || !properties.empty()) {
+ bool isAutoDeleted = false;
qpid::types::Variant::Map requested = properties;
if (!type.empty()) requested[SUPPORTED_DIST_MODES] = type == TOPIC ? COPY : MOVE;
if (durableNode) requested[DURABLE] = true;
@@ -673,13 +674,23 @@ void AddressHelper::checkAssertion(pn_terminus_t* terminus, CheckMode mode)
pn_data_next(data);
qpid::types::Variant::Map::const_iterator j = requested.find(key);
qpid::types::Variant v;
- if (j != requested.end() &&
- ((key == LIFETIME_POLICY && checkLifetimePolicy(j->second.asString(), data)) ||
- (read(data, v) && v.asString() == j->second.asString()))) {
+ if (key == LIFETIME_POLICY) {
+ isAutoDeleted = true;
+ if (j != requested.end() && checkLifetimePolicy(j->second.asString(), data)) {
+ requested.erase(j->first);
+ }
+ } else if (key == AUTO_DELETE) {
+ read(data, v);
+ isAutoDeleted = v.asBool();
+ } else if (j != requested.end() && (read(data, v) && v.asString() == j->second.asString())) {
requested.erase(j->first);
}
}
pn_data_exit(data);
+ qpid::types::Variant::Map::iterator i = requested.find(AUTO_DELETE);
+ if (i != requested.end() && i->second.asBool() == isAutoDeleted) {
+ requested.erase(i);
+ }
if (!requested.empty()) {
std::stringstream missing;
missing << "Requested node properties not met: " << requested;