diff options
| author | Gordon Sim <gsim@apache.org> | 2007-10-04 16:06:05 +0000 |
|---|---|---|
| committer | Gordon Sim <gsim@apache.org> | 2007-10-04 16:06:05 +0000 |
| commit | 03f1df9ff7894a6d910120c82bba49e6193178ee (patch) | |
| tree | e27792701ea80e1aa83d1c5730da71502374d25d /cpp/src/qpid/broker/SemanticHandler.cpp | |
| parent | c848c1a4e6be50176f10170c6422c5e4d5385770 (diff) | |
| download | qpid-python-03f1df9ff7894a6d910120c82bba49e6193178ee.tar.gz | |
Additional tests and fixes
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@581957 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/broker/SemanticHandler.cpp')
| -rw-r--r-- | cpp/src/qpid/broker/SemanticHandler.cpp | 14 |
1 files changed, 6 insertions, 8 deletions
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 <boost/format.hpp> +#include <boost/bind.hpp> 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() |
