From b31130203c660351313fa931ea30a8b79e813fef Mon Sep 17 00:00:00 2001 From: Justin Ross Date: Mon, 18 Mar 2013 19:18:39 +0000 Subject: QPID-4658: Update statistics even when no binding key matches routing key This is a patch from Pavel Moravec. Thanks to Ernie Allen for testing it and fixit it for latest trunk. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1457924 13f79535-47bb-0310-9956-ffa450edef68 --- qpid/cpp/src/qpid/xml/XmlExchange.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/qpid/cpp/src/qpid/xml/XmlExchange.cpp b/qpid/cpp/src/qpid/xml/XmlExchange.cpp index 1f6bf6de05..fb6c326327 100644 --- a/qpid/cpp/src/qpid/xml/XmlExchange.cpp +++ b/qpid/cpp/src/qpid/xml/XmlExchange.cpp @@ -321,14 +321,16 @@ void XmlExchange::route(Deliverable& msg) { RWlock::ScopedRlock l(lock); p = bindingsMap[routingKey].snapshot(); - if (!p.get()) return; } - for (std::vector::const_iterator i = p->begin(); i != p->end(); i++) { - if (matches((*i)->xquery, msg, (*i)->parse_message_content)) { - b->push_back(*i); - } + if (p.get()) { + for (std::vector::const_iterator i = p->begin(); i != p->end(); i++) { + if (matches((*i)->xquery, msg, (*i)->parse_message_content)) { + b->push_back(*i); + } + } } + // else allow stats to be counted, even for non-matched messages doRoute(msg, b); } catch (...) { QPID_LOG(warning, "XMLExchange " << getName() << ": exception routing message with query " << routingKey); -- cgit v1.2.1