diff options
| author | Charles E. Rolke <chug@apache.org> | 2013-06-28 21:15:35 +0000 |
|---|---|---|
| committer | Charles E. Rolke <chug@apache.org> | 2013-06-28 21:15:35 +0000 |
| commit | 1c3e6d4b908eab9501ee39e3e0d171837003dc4d (patch) | |
| tree | 3ab255f7c6f697513b25c815fd3229490c098536 /qpid/cpp/src | |
| parent | 891eaaacb213d5fa8f1c626cf5bb648802ff6796 (diff) | |
| download | qpid-python-1c3e6d4b908eab9501ee39e3e0d171837003dc4d.tar.gz | |
QPID-4969: Headers exchange allows bindings with duplicate managementId.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1497926 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/src')
| -rw-r--r-- | qpid/cpp/src/qpid/broker/HeadersExchange.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/qpid/cpp/src/qpid/broker/HeadersExchange.cpp b/qpid/cpp/src/qpid/broker/HeadersExchange.cpp index 611978beef..204f5cf676 100644 --- a/qpid/cpp/src/qpid/broker/HeadersExchange.cpp +++ b/qpid/cpp/src/qpid/broker/HeadersExchange.cpp @@ -198,6 +198,17 @@ bool HeadersExchange::bind(Queue::shared_ptr queue, const string& bindingKey, co 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 |
