You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ac...@apache.org on 2007/01/15 14:58:08 UTC

svn commit: r496317 - in /incubator/qpid/trunk/qpid/cpp: gen/ lib/broker/AccumulatedAck.h lib/broker/BrokerChannel.cpp tests/AccumulatedAckTest.cpp tests/TxAckTest.cpp

Author: aconway
Date: Mon Jan 15 05:58:07 2007
New Revision: 496317

URL: http://svn.apache.org/viewvc?view=rev&rev=496317
Log:
2006-12-08  Jim Meyering  <me...@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.

Modified:
    incubator/qpid/trunk/qpid/cpp/gen/   (props changed)
    incubator/qpid/trunk/qpid/cpp/lib/broker/AccumulatedAck.h
    incubator/qpid/trunk/qpid/cpp/lib/broker/BrokerChannel.cpp
    incubator/qpid/trunk/qpid/cpp/tests/AccumulatedAckTest.cpp
    incubator/qpid/trunk/qpid/cpp/tests/TxAckTest.cpp

Propchange: incubator/qpid/trunk/qpid/cpp/gen/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Mon Jan 15 05:58:07 2007
@@ -103,3 +103,4 @@
 TxSelectOkBody.h
 timestamp
 gen-src.mk
+AMQP_HighestVersion.h

Modified: incubator/qpid/trunk/qpid/cpp/lib/broker/AccumulatedAck.h
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/lib/broker/AccumulatedAck.h?view=diff&rev=496317&r1=496316&r2=496317
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/lib/broker/AccumulatedAck.h (original)
+++ incubator/qpid/trunk/qpid/cpp/lib/broker/AccumulatedAck.h Mon Jan 15 05:58:07 2007
@@ -31,7 +31,8 @@
          * 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 @@
              */
             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();

Modified: incubator/qpid/trunk/qpid/cpp/lib/broker/BrokerChannel.cpp
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/lib/broker/BrokerChannel.cpp?view=diff&rev=496317&r1=496316&r2=496317
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/lib/broker/BrokerChannel.cpp (original)
+++ incubator/qpid/trunk/qpid/cpp/lib/broker/BrokerChannel.cpp Mon Jan 15 05:58:07 2007
@@ -40,6 +40,7 @@
     prefetchCount(0),
     framesize(_framesize),
     tagGenerator("sgen"),
+    accumulatedAck(0),
     store(_store),
     messageBuilder(this, _store, _stagingThreshold),
     version(_version){

Modified: incubator/qpid/trunk/qpid/cpp/tests/AccumulatedAckTest.cpp
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/tests/AccumulatedAckTest.cpp?view=diff&rev=496317&r1=496316&r2=496317
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/tests/AccumulatedAckTest.cpp (original)
+++ incubator/qpid/trunk/qpid/cpp/tests/AccumulatedAckTest.cpp Mon Jan 15 05:58:07 2007
@@ -36,8 +36,7 @@
     public:
         void testCovers()
         {
-            AccumulatedAck ack;
-            ack.range = 5;
+            AccumulatedAck ack(5);
             ack.individual.push_back(7);
             ack.individual.push_back(9);
             
@@ -56,8 +55,7 @@
 
         void testUpdateAndConsolidate()
         {
-            AccumulatedAck ack;
-            ack.clear();
+            AccumulatedAck ack(0);
             ack.update(1, false);
             ack.update(3, false);
             ack.update(10, false);

Modified: incubator/qpid/trunk/qpid/cpp/tests/TxAckTest.cpp
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/tests/TxAckTest.cpp?view=diff&rev=496317&r1=496316&r2=496317
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/tests/TxAckTest.cpp (original)
+++ incubator/qpid/trunk/qpid/cpp/tests/TxAckTest.cpp Mon Jan 15 05:58:07 2007
@@ -66,7 +66,7 @@
 
 public:
 
-    TxAckTest() : queue(new Queue("my_queue", false, &store, 0)), op(acked, deliveries, &xid)
+    TxAckTest() : acked(0), queue(new Queue("my_queue", false, &store, 0)), op(acked, deliveries, &xid)
     {
         for(int i = 0; i < 10; i++){
             Message::shared_ptr msg(new Message(0, "exchange", "routing_key", false, false));