diff options
| author | Kim van der Riet <kpvdr@apache.org> | 2009-09-14 15:20:13 +0000 |
|---|---|---|
| committer | Kim van der Riet <kpvdr@apache.org> | 2009-09-14 15:20:13 +0000 |
| commit | 683a5677a37def4ed3c564fbebfe8951bcf86142 (patch) | |
| tree | 5ebe32fcb4a61f32eb12c64e05eceb402d8b5300 /cpp/src/qpid/broker/HeadersExchange.cpp | |
| parent | d84a5a7e693922fbb18d7db020c28be8471f11e3 (diff) | |
| download | qpid-python-683a5677a37def4ed3c564fbebfe8951bcf86142.tar.gz | |
Reversed checkin of r.813825 until its problems can be resolved
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@814692 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/broker/HeadersExchange.cpp')
| -rw-r--r-- | cpp/src/qpid/broker/HeadersExchange.cpp | 34 |
1 files changed, 24 insertions, 10 deletions
diff --git a/cpp/src/qpid/broker/HeadersExchange.cpp b/cpp/src/qpid/broker/HeadersExchange.cpp index e4825344a0..c628c44909 100644 --- a/cpp/src/qpid/broker/HeadersExchange.cpp +++ b/cpp/src/qpid/broker/HeadersExchange.cpp @@ -7,9 +7,9 @@ * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY @@ -118,17 +118,31 @@ void HeadersExchange::route(Deliverable& msg, const string& /*routingKey*/, cons PreRoute pr(msg, this); + uint32_t count(0); + Bindings::ConstPtr p = bindings.snapshot(); - Bindings::Ptr b(new std::vector<boost::shared_ptr<qpid::broker::Exchange::Binding> >); - if (p.get()) - { + if (p.get()){ for (std::vector<Binding::shared_ptr>::const_iterator i = p->begin(); i != p->end(); ++i) { if (match((*i)->args, *args)) { - b->push_back(*i); + msg.deliverTo((*i)->queue); + count++; + if ((*i)->mgmtBinding != 0) + (*i)->mgmtBinding->inc_msgMatched(); } } } - doRoute(msg, b); + + if (mgmtExchange != 0) { + mgmtExchange->inc_msgReceives(); + mgmtExchange->inc_byteReceives(msg.contentSize()); + if (count == 0) { + mgmtExchange->inc_msgDrops(); + mgmtExchange->inc_byteDrops(msg.contentSize()); + } else { + mgmtExchange->inc_msgRoutes(count); + mgmtExchange->inc_byteRoutes(count * msg.contentSize()); + } + } } @@ -149,7 +163,7 @@ HeadersExchange::~HeadersExchange() {} const std::string HeadersExchange::typeName("headers"); -namespace +namespace { bool match_values(const FieldValue& bind, const FieldValue& msg) { @@ -167,7 +181,7 @@ bool HeadersExchange::match(const FieldTable& bind, const FieldTable& msg) { i != bind.end(); ++i) { - if (i->first != x_match) + if (i->first != x_match) { Map::const_iterator j = msg.find(i->first); if (j == msg.end()) return false; @@ -180,7 +194,7 @@ bool HeadersExchange::match(const FieldTable& bind, const FieldTable& msg) { i != bind.end(); ++i) { - if (i->first != x_match) + if (i->first != x_match) { Map::const_iterator j = msg.find(i->first); if (j != msg.end()) { |
