summaryrefslogtreecommitdiff
path: root/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
commitb2fec850e199f73a64c42f93ce8c95f7a81d518d (patch)
tree48258afa30545a8b20fb1825ab868e9ad35c59d6 /cpp
parent77a0927ded844a58fead8ab39a60644c8211c5d2 (diff)
downloadqpid-python-b2fec850e199f73a64c42f93ce8c95f7a81d518d.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/qpid@830751 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp')
-rw-r--r--cpp/src/qpid/broker/SessionAdapter.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/cpp/src/qpid/broker/SessionAdapter.cpp b/cpp/src/qpid/broker/SessionAdapter.cpp
index 65eadda68a..1a802cb2bd 100644
--- a/cpp/src/qpid/broker/SessionAdapter.cpp
+++ b/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) {