Return-Path: X-Original-To: apmail-qpid-commits-archive@www.apache.org Delivered-To: apmail-qpid-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id E6BC8101A6 for ; Fri, 28 Jun 2013 21:15:57 +0000 (UTC) Received: (qmail 38943 invoked by uid 500); 28 Jun 2013 21:15:57 -0000 Delivered-To: apmail-qpid-commits-archive@qpid.apache.org Received: (qmail 38923 invoked by uid 500); 28 Jun 2013 21:15:57 -0000 Mailing-List: contact commits-help@qpid.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@qpid.apache.org Delivered-To: mailing list commits@qpid.apache.org Received: (qmail 38916 invoked by uid 99); 28 Jun 2013 21:15:57 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 28 Jun 2013 21:15:57 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 28 Jun 2013 21:15:55 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id A84C9238889B; Fri, 28 Jun 2013 21:15:35 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1497926 - /qpid/trunk/qpid/cpp/src/qpid/broker/HeadersExchange.cpp Date: Fri, 28 Jun 2013 21:15:35 -0000 To: commits@qpid.apache.org From: chug@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20130628211535.A84C9238889B@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org 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::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