summaryrefslogtreecommitdiff
path: root/qpid/cpp/lib
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2007-01-15 13:58:07 +0000
committerAlan Conway <aconway@apache.org>2007-01-15 13:58:07 +0000
commitea0eb5e1a4844b6a36a7087239b2e813fc858ebe (patch)
tree462d1884f98b59260b1524ad788902ffe5bdd664 /qpid/cpp/lib
parent71c036d96d72fae9844da047a1ac1000f143c384 (diff)
downloadqpid-python-ea0eb5e1a4844b6a36a7087239b2e813fc858ebe.tar.gz
2006-12-08 Jim Meyering <meyering@redhat.com>
Ensure that AccumulatedAck.range is not used uninitialized. * lib/broker/AccumulatedAck.h (AccumulatedAck): Make this a class, rather than a struct. (AccumulatedAck::AccumulatedAck): Add a constructor to require initialization of the "range" member. * lib/broker/BrokerChannel.cpp (Channel) [accumulatedAck]: Initialize. * tests/TxAckTest.cpp (TxAckTest) [acked]: Likewise. * tests/AccumulatedAckTest.cpp (testCovers): Initialize local. (testUpdateAndConsolidate): Likewise. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk@496317 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/lib')
-rw-r--r--qpid/cpp/lib/broker/AccumulatedAck.h4
-rw-r--r--qpid/cpp/lib/broker/BrokerChannel.cpp1
2 files changed, 4 insertions, 1 deletions
diff --git a/qpid/cpp/lib/broker/AccumulatedAck.h b/qpid/cpp/lib/broker/AccumulatedAck.h
index 055c8ea3e0..c472f7f3ea 100644
--- a/qpid/cpp/lib/broker/AccumulatedAck.h
+++ b/qpid/cpp/lib/broker/AccumulatedAck.h
@@ -31,7 +31,8 @@ namespace qpid {
* Keeps an accumulated record of acked messages (by delivery
* tag).
*/
- struct AccumulatedAck{
+ class AccumulatedAck {
+ public:
/**
* If not zero, then everything up to this value has been
* acked.
@@ -43,6 +44,7 @@ namespace qpid {
*/
std::list<u_int64_t> individual;
+ AccumulatedAck(u_int64_t r) : range(r) {}
void update(u_int64_t tag, bool multiple);
void consolidate();
void clear();
diff --git a/qpid/cpp/lib/broker/BrokerChannel.cpp b/qpid/cpp/lib/broker/BrokerChannel.cpp
index f569872770..65aa50d3ac 100644
--- a/qpid/cpp/lib/broker/BrokerChannel.cpp
+++ b/qpid/cpp/lib/broker/BrokerChannel.cpp
@@ -40,6 +40,7 @@ Channel::Channel(qpid::framing::ProtocolVersion& _version, OutputHandler* _out,
prefetchCount(0),
framesize(_framesize),
tagGenerator("sgen"),
+ accumulatedAck(0),
store(_store),
messageBuilder(this, _store, _stagingThreshold),
version(_version){