summaryrefslogtreecommitdiff
path: root/qpid/cpp/src
diff options
context:
space:
mode:
authorKim van der Riet <kpvdr@apache.org>2009-10-29 13:20:07 +0000
committerKim van der Riet <kpvdr@apache.org>2009-10-29 13:20:07 +0000
commit03ad83bee4203ff63195acd6a11aa2b61f6a6031 (patch)
tree62b8995bb9a3bf9f10a7a6db068d22b9420652bd /qpid/cpp/src
parent6c99eda3cdf6a6a068baf8302e23a396f5d6153e (diff)
downloadqpid-python-03ad83bee4203ff63195acd6a11aa2b61f6a6031.tar.gz
Fix for QPID-2171 "No checks made for reserved exchange names "amq.*" and "qpid.*". This checkin adds the qpid check, r.830751 added the amq check. Python tests also inlcuded which checks for these prefixes.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@830930 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/src')
-rw-r--r--qpid/cpp/src/qpid/broker/SessionAdapter.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/qpid/cpp/src/qpid/broker/SessionAdapter.cpp b/qpid/cpp/src/qpid/broker/SessionAdapter.cpp
index 1a802cb2bd..5e5d79343a 100644
--- a/qpid/cpp/src/qpid/broker/SessionAdapter.cpp
+++ b/qpid/cpp/src/qpid/broker/SessionAdapter.cpp
@@ -85,8 +85,8 @@ 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 << "\")"));
+ if(exchange.find("amq.") == 0 || exchange.find("qpid.") == 0) {
+ throw framing::NotAllowedException(QPID_MSG("Exchange names beginning with \"amq.\" or \"qpid.\" are reserved. (exchange=\"" << exchange << "\")"));
}
try{
std::pair<Exchange::shared_ptr, bool> response = getBroker().getExchanges().declare(exchange, type, durable, args);