summaryrefslogtreecommitdiff
path: root/cpp/src/qpid
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src/qpid')
-rw-r--r--cpp/src/qpid/broker/BrokerAdapter.cpp1
-rw-r--r--cpp/src/qpid/broker/ExchangeRegistry.cpp6
-rw-r--r--cpp/src/qpid/broker/HeadersExchange.cpp2
3 files changed, 4 insertions, 5 deletions
diff --git a/cpp/src/qpid/broker/BrokerAdapter.cpp b/cpp/src/qpid/broker/BrokerAdapter.cpp
index 93a3a319ac..c31f4d197d 100644
--- a/cpp/src/qpid/broker/BrokerAdapter.cpp
+++ b/cpp/src/qpid/broker/BrokerAdapter.cpp
@@ -153,7 +153,6 @@ void BrokerAdapter::ExchangeHandlerImpl::declare(const MethodContext& context, u
void BrokerAdapter::ExchangeHandlerImpl::delete_(const MethodContext& context, uint16_t /*ticket*/,
const string& name, bool /*ifUnused*/, bool nowait){
-
//TODO: implement unused
Exchange::shared_ptr exchange(broker.getExchanges().get(name));
if (exchange->isDurable()) broker.getStore().destroy(*exchange);
diff --git a/cpp/src/qpid/broker/ExchangeRegistry.cpp b/cpp/src/qpid/broker/ExchangeRegistry.cpp
index 3bf211b960..9555fa43a4 100644
--- a/cpp/src/qpid/broker/ExchangeRegistry.cpp
+++ b/cpp/src/qpid/broker/ExchangeRegistry.cpp
@@ -71,10 +71,10 @@ void ExchangeRegistry::destroy(const string& name){
Exchange::shared_ptr ExchangeRegistry::get(const string& name){
Mutex::ScopedLock locker(lock);
- Exchange::shared_ptr exchange =exchanges[name];
- if (!exchange)
+ ExchangeMap::iterator i = exchanges.find(name);
+ if (i == exchanges.end())
throw ChannelException(404, "Exchange not found:" + name);
- return exchange;
+ return i->second;
}
namespace
diff --git a/cpp/src/qpid/broker/HeadersExchange.cpp b/cpp/src/qpid/broker/HeadersExchange.cpp
index a9405e1f6d..36f7330433 100644
--- a/cpp/src/qpid/broker/HeadersExchange.cpp
+++ b/cpp/src/qpid/broker/HeadersExchange.cpp
@@ -84,7 +84,7 @@ void HeadersExchange::route(Deliverable& msg, const string& /*routingKey*/, cons
bool HeadersExchange::isBound(Queue::shared_ptr queue, const string* const, const FieldTable* const args)
{
for (Bindings::iterator i = bindings.begin(); i != bindings.end(); ++i) {
- if ( (!args || equal(i->first, *args)) && i->second == queue) {
+ if ( (!args || equal(i->first, *args)) && (!queue || i->second == queue)) {
return true;
}
}