From 03f30044cd047c423fef86677e74c99eec0b504c Mon Sep 17 00:00:00 2001 From: Kim van der Riet Date: Wed, 28 Oct 2009 20:24:51 +0000 Subject: 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 --- qpid/cpp/src/qpid/broker/SessionAdapter.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'qpid/cpp') 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 response = getBroker().getExchanges().declare(exchange, type, durable, args); if (response.second) { -- cgit v1.2.1