You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by tr...@apache.org on 2009/05/20 17:32:58 UTC

svn commit: r776734 - /qpid/trunk/qpid/cpp/src/qpid/broker/ExchangeRegistry.cpp

Author: tross
Date: Wed May 20 15:32:57 2009
New Revision: 776734

URL: http://svn.apache.org/viewvc?rev=776734&view=rev
Log:
QPID-1865 - Block the deletion of default exchanges.

Modified:
    qpid/trunk/qpid/cpp/src/qpid/broker/ExchangeRegistry.cpp

Modified: qpid/trunk/qpid/cpp/src/qpid/broker/ExchangeRegistry.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/broker/ExchangeRegistry.cpp?rev=776734&r1=776733&r2=776734&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/broker/ExchangeRegistry.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/broker/ExchangeRegistry.cpp Wed May 20 15:32:57 2009
@@ -71,6 +71,11 @@
 }
 
 void ExchangeRegistry::destroy(const string& name){
+    if (name.empty() ||
+        (name.find("amq.") == 0 &&
+         (name == "amq.direct" || name == "amq.fanout" || name == "amq.topic" || name == "amq.match")) ||
+        name == "qpid.management")
+        throw framing::NotAllowedException(QPID_MSG("Cannot delete default exchange: '" << name << "'"));
     RWlock::ScopedWlock locker(lock);
     ExchangeMap::iterator i =  exchanges.find(name);
     if (i != exchanges.end()) {



---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:commits-subscribe@qpid.apache.org