qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From c...@apache.org
Subject svn commit: r1497926 - /qpid/trunk/qpid/cpp/src/qpid/broker/HeadersExchange.cpp
Date Fri, 28 Jun 2013 21:15:35 GMT
Author: chug
Date: Fri Jun 28 21:15:35 2013
New Revision: 1497926

URL: http://svn.apache.org/r1497926
Log:
QPID-4969: Headers exchange allows bindings with duplicate managementId.


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

Modified: qpid/trunk/qpid/cpp/src/qpid/broker/HeadersExchange.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/broker/HeadersExchange.cpp?rev=1497926&r1=1497925&r2=1497926&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/broker/HeadersExchange.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/broker/HeadersExchange.cpp Fri Jun 28 21:15:35 2013
@@ -198,6 +198,17 @@ bool HeadersExchange::bind(Queue::shared
             throw InternalErrorException(QPID_MSG("Invalid or missing x-match value binding
to headers exchange. Must be a string [\"all\" or \"any\"]"));
         }
 
+        Bindings::ConstPtr p = bindings.snapshot();
+        if (p.get()) {
+            for (std::vector<BoundKey>::const_iterator i = p->begin(); i != p->end();
++i) {
+                if (queue == i->binding->queue && bindingKey == i->binding->key)
{
+                    throw InternalErrorException(QPID_MSG("Exchange: " << getName()
+                        << ", binding key: " << bindingKey
+                        << " Duplicate binding key not allowed." ));
+                }
+            }
+        }
+
         {
             Mutex::ScopedLock l(lock);
             //NOTE: do not include the fed op/tags/origin in the



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


Mime
View raw message