From 8d10631aebd3de4b8cf88083af12549c0f2af0f5 Mon Sep 17 00:00:00 2001 From: Alan Conway Date: Mon, 16 Apr 2007 20:50:45 +0000 Subject: * qpidc.spec.in: bump RPM revision for bugfix. * src/qpid/framing/Correlator.cpp: Fix memory bug in correlator. * src/tests/Makefile.am: Re-enable ClientChannelTest, bug fixed. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@529397 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/src/qpid/framing/Correlator.cpp | 11 ++++++----- cpp/src/tests/Makefile.am | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) (limited to 'cpp/src') diff --git a/cpp/src/qpid/framing/Correlator.cpp b/cpp/src/qpid/framing/Correlator.cpp index 1c18f6b414..feeb3aa935 100644 --- a/cpp/src/qpid/framing/Correlator.cpp +++ b/cpp/src/qpid/framing/Correlator.cpp @@ -27,16 +27,17 @@ void Correlator::request(RequestId id, Action action) { bool Correlator::response(shared_ptr r) { Actions::iterator begin = actions.lower_bound(r->getRequestId()); - Actions::iterator end = - actions.upper_bound(r->getRequestId()+r->getBatchOffset()); + RequestId last = r->getRequestId()+r->getBatchOffset(); + Actions::iterator i = begin; bool didAction = false; - for(Actions::iterator i=begin; i != end; ++i) { - // FIXME aconway 2007-04-04: Exception handling. + for( ; i != actions.end() && i->first <= last; ++i) { didAction = true; + // FIXME aconway 2007-04-04: handle exceptions thrown by action. i->second(r); - actions.erase(i); } + actions.erase(begin, i); return didAction; } + }} // namespace qpid::framing diff --git a/cpp/src/tests/Makefile.am b/cpp/src/tests/Makefile.am index e1a91fa8c7..6ca81f960f 100644 --- a/cpp/src/tests/Makefile.am +++ b/cpp/src/tests/Makefile.am @@ -24,7 +24,7 @@ broker_unit_tests = \ MessageHandlerTest #client_unit_tests = \ -# ClientChannelTest + ClientChannelTest framing_unit_tests = \ FieldTableTest \ -- cgit v1.2.1