summaryrefslogtreecommitdiff
path: root/qpid/cpp/src
diff options
context:
space:
mode:
Diffstat (limited to 'qpid/cpp/src')
-rw-r--r--qpid/cpp/src/qpid/broker/amqp/NodeProperties.cpp7
-rw-r--r--qpid/cpp/src/qpid/broker/amqp/NodeProperties.h3
-rw-r--r--qpid/cpp/src/qpid/broker/amqp/Session.cpp2
3 files changed, 9 insertions, 3 deletions
diff --git a/qpid/cpp/src/qpid/broker/amqp/NodeProperties.cpp b/qpid/cpp/src/qpid/broker/amqp/NodeProperties.cpp
index 586ff6d439..2072eb35b9 100644
--- a/qpid/cpp/src/qpid/broker/amqp/NodeProperties.cpp
+++ b/qpid/cpp/src/qpid/broker/amqp/NodeProperties.cpp
@@ -54,6 +54,7 @@ const std::string EXCLUSIVE("exclusive");
const std::string AUTO_DELETE("auto-delete");
const std::string ALTERNATE_EXCHANGE("alternate-exchange");
const std::string EXCHANGE_TYPE("exchange-type");
+const std::string EMPTY;
pn_bytes_t convert(const std::string& s)
{
@@ -113,7 +114,7 @@ void NodeProperties::read(pn_data_t* data)
}
-bool NodeProperties::wasSpecified(const std::string& key)
+bool NodeProperties::wasSpecified(const std::string& key) const
{
return specified.find(key) != specified.end();
}
@@ -362,6 +363,10 @@ std::string NodeProperties::getExchangeType() const
{
return exchangeType;
}
+std::string NodeProperties::getSpecifiedExchangeType() const
+{
+ return wasSpecified(EXCHANGE_TYPE) ? exchangeType : EMPTY;
+}
std::string NodeProperties::getAlternateExchange() const
{
return alternateExchange;
diff --git a/qpid/cpp/src/qpid/broker/amqp/NodeProperties.h b/qpid/cpp/src/qpid/broker/amqp/NodeProperties.h
index e1f0d3e792..414ca3f1e8 100644
--- a/qpid/cpp/src/qpid/broker/amqp/NodeProperties.h
+++ b/qpid/cpp/src/qpid/broker/amqp/NodeProperties.h
@@ -65,6 +65,7 @@ class NodeProperties : public qpid::amqp::MapReader
bool isExclusive() const;
bool isAutodelete() const;
std::string getExchangeType() const;
+ std::string getSpecifiedExchangeType() const;
std::string getAlternateExchange() const;
bool trackControllingLink() const;
const qpid::types::Variant::Map& getProperties() const;
@@ -81,7 +82,7 @@ class NodeProperties : public qpid::amqp::MapReader
std::set<std::string> specified;
void process(const std::string&, const qpid::types::Variant&, const qpid::amqp::Descriptor*);
- bool wasSpecified(const std::string& key);
+ bool wasSpecified(const std::string& key) const;
};
}}} // namespace qpid::broker::amqp
diff --git a/qpid/cpp/src/qpid/broker/amqp/Session.cpp b/qpid/cpp/src/qpid/broker/amqp/Session.cpp
index ab677faac3..2c4c9a6183 100644
--- a/qpid/cpp/src/qpid/broker/amqp/Session.cpp
+++ b/qpid/cpp/src/qpid/broker/amqp/Session.cpp
@@ -234,7 +234,7 @@ Session::ResolvedNode Session::resolve(const std::string name, pn_terminus_t* te
node.properties.read(pn_terminus_properties(terminus));
if (node.exchange && createOnDemand && isTopicRequested) {
- if (!node.properties.getExchangeType().empty() && node.properties.getExchangeType() != node.exchange->getType()) {
+ if (!node.properties.getSpecifiedExchangeType().empty() && node.properties.getExchangeType() != node.exchange->getType()) {
//emulate 0-10 exchange-declare behaviour
throw Exception(qpid::amqp::error_conditions::PRECONDITION_FAILED, "Exchange of different type already exists");
}