From 03f1df9ff7894a6d910120c82bba49e6193178ee Mon Sep 17 00:00:00 2001 From: Gordon Sim Date: Thu, 4 Oct 2007 16:06:05 +0000 Subject: Additional tests and fixes git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@581957 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/src/qpid/broker/SemanticHandler.cpp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'cpp/src/qpid/broker/SemanticHandler.cpp') diff --git a/cpp/src/qpid/broker/SemanticHandler.cpp b/cpp/src/qpid/broker/SemanticHandler.cpp index 9cacb4ccf7..dc5407be99 100644 --- a/cpp/src/qpid/broker/SemanticHandler.cpp +++ b/cpp/src/qpid/broker/SemanticHandler.cpp @@ -31,12 +31,16 @@ #include "qpid/framing/InvocationVisitor.h" #include +#include using namespace qpid::broker; using namespace qpid::framing; using namespace qpid::sys; -SemanticHandler::SemanticHandler(SessionState& s) : state(*this,s), session(s) {} +SemanticHandler::SemanticHandler(SessionState& s) : + state(*this,s), session(s), + ackOp(boost::bind(&SemanticState::ackRange, &state, _1, _2)) + {} void SemanticHandler::handle(framing::AMQFrame& frame) { @@ -81,13 +85,7 @@ void SemanticHandler::complete(uint32_t cumulative, const SequenceNumberSet& ran //ack messages: state.ackCumulative(mark.getValue()); } - if (range.size() % 2) { //must be even number - throw ConnectionException(530, "Received odd number of elements in ranged mark"); - } else { - for (SequenceNumberSet::const_iterator i = range.begin(); i != range.end(); i++) { - state.ackRange(*i, *(++i)); - } - } + range.processRanges(ackOp); } void SemanticHandler::sendCompletion() -- cgit v1.2.1