summaryrefslogtreecommitdiff
path: root/qpid/cpp
diff options
context:
space:
mode:
authorKim van der Riet <kpvdr@apache.org>2009-10-28 20:24:51 +0000
committerKim van der Riet <kpvdr@apache.org>2009-10-28 20:24:51 +0000
commit03f30044cd047c423fef86677e74c99eec0b504c (patch)
tree72dfed155a816ae01535ecdfb97eacb4985f213b /qpid/cpp
parentd39084bb979ff7a39432ba5cecd8c3f097ff3e53 (diff)
downloadqpid-python-03f30044cd047c423fef86677e74c99eec0b504c.tar.gz
Fixed lack of checking for reserved exchange names that start with "amq." according to the AMQP spec. Added a python test for this functionality.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@830751 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp')
-rw-r--r--qpid/cpp/src/qpid/broker/SessionAdapter.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/qpid/cpp/src/qpid/broker/SessionAdapter.cpp b/qpid/cpp/src/qpid/broker/SessionAdapter.cpp
index 65eadda68a..1a802cb2bd 100644
--- a/qpid/cpp/src/qpid/broker/SessionAdapter.cpp
+++ b/qpid/cpp/src/qpid/broker/SessionAdapter.cpp
@@ -85,6 +85,9 @@ void SessionAdapter::ExchangeHandlerImpl::declare(const string& exchange, const
checkType(actual, type);
checkAlternate(actual, alternate);
}else{
+ if(exchange.find("amq.") == 0) {
+ throw framing::NotAllowedException(QPID_MSG("Exchange names beginning with \"amq.\" are reserved. (exchange=\"" << exchange << "\")"));
+ }
try{
std::pair<Exchange::shared_ptr, bool> response = getBroker().getExchanges().declare(exchange, type, durable, args);
if (response.second) {