diff options
Diffstat (limited to 'cpp/src/qpid')
-rw-r--r-- | cpp/src/qpid/broker/Broker.cpp | 6 | ||||
-rw-r--r-- | cpp/src/qpid/broker/Broker.h | 2 | ||||
-rw-r--r-- | cpp/src/qpid/management/ManagementAgent.cpp | 14 |
3 files changed, 17 insertions, 5 deletions
diff --git a/cpp/src/qpid/broker/Broker.cpp b/cpp/src/qpid/broker/Broker.cpp index c5662d763a..695a926f74 100644 --- a/cpp/src/qpid/broker/Broker.cpp +++ b/cpp/src/qpid/broker/Broker.cpp @@ -593,7 +593,7 @@ void Broker::createObject(const std::string& type, const std::string& name, } } else if (type == TYPE_EXCHANGE || type == TYPE_TOPIC) { bool durable(false); - std::string exchangeType; + std::string exchangeType("topic"); std::string alternateExchange; Variant::Map extensions; for (Variant::Map::const_iterator i = properties.begin(); i != properties.end(); ++i) { @@ -787,7 +787,7 @@ std::pair<boost::shared_ptr<Queue>, bool> Broker::createQueue( Exchange::shared_ptr alternate; if (!alternateExchange.empty()) { alternate = exchanges.get(alternateExchange); - if (!alternate) framing::NotFoundException(QPID_MSG("Alternate exchange does not exist: " << alternateExchange)); + if (!alternate) throw framing::NotFoundException(QPID_MSG("Alternate exchange does not exist: " << alternateExchange)); } std::pair<Queue::shared_ptr, bool> result = queues.declare(name, durable, autodelete, owner); @@ -859,7 +859,7 @@ std::pair<Exchange::shared_ptr, bool> Broker::createExchange( Exchange::shared_ptr alternate; if (!alternateExchange.empty()) { alternate = exchanges.get(alternateExchange); - if (!alternate) framing::NotFoundException(QPID_MSG("Alternate exchange does not exist: " << alternateExchange)); + if (!alternate) throw framing::NotFoundException(QPID_MSG("Alternate exchange does not exist: " << alternateExchange)); } std::pair<Exchange::shared_ptr, bool> result; diff --git a/cpp/src/qpid/broker/Broker.h b/cpp/src/qpid/broker/Broker.h index d85927c43c..32c3d7936f 100644 --- a/cpp/src/qpid/broker/Broker.h +++ b/cpp/src/qpid/broker/Broker.h @@ -153,7 +153,7 @@ public: void setLogLevel(const std::string& level); std::string getLogLevel(); void createObject(const std::string& type, const std::string& name, - const qpid::types::Variant::Map& properties, bool lenient, const ConnectionState* context); + const qpid::types::Variant::Map& properties, bool strict, const ConnectionState* context); void deleteObject(const std::string& type, const std::string& name, const qpid::types::Variant::Map& options, const ConnectionState* context); diff --git a/cpp/src/qpid/management/ManagementAgent.cpp b/cpp/src/qpid/management/ManagementAgent.cpp index 8b4defaa73..f88b9c0931 100644 --- a/cpp/src/qpid/management/ManagementAgent.cpp +++ b/cpp/src/qpid/management/ManagementAgent.cpp @@ -75,6 +75,18 @@ namespace { } return n2; } + +struct ScopedManagementContext +{ + ScopedManagementContext(const qpid::broker::ConnectionState* context) + { + setManagementExecutionContext(context); + } + ~ScopedManagementContext() + { + setManagementExecutionContext(0); + } +}; } @@ -2238,7 +2250,7 @@ void ManagementAgent::dispatchAgentCommandLH(Message& msg, bool viaLocal) uint32_t bufferLen = inBuffer.getPosition(); inBuffer.reset(); - setManagementExecutionContext((const qpid::broker::ConnectionState*) msg.getPublisher()); + ScopedManagementContext context((const qpid::broker::ConnectionState*) msg.getPublisher()); const framing::FieldTable *headers = msg.getApplicationHeaders(); if (headers && msg.getAppId() == "qmf2") { |