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/03/13 21:14:32 UTC

svn commit: r517849 - in /incubator/qpid/branches/qpid.0-9: ./ cpp/lib/broker/AccumulatedAck.h cpp/lib/broker/BrokerChannel.cpp cpp/tests/AccumulatedAckTest.cpp cpp/tests/TxAckTest.cpp

Author: aconway
Date: Tue Mar 13 13:14:31 2007
New Revision: 517849

URL: http://svn.apache.org/viewvc?view=rev&rev=517849
Log:
Merged revisions 496317 via svnmerge from 
https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid

........
  r496317 | aconway | 2007-01-15 08:58:07 -0500 (Mon, 15 Jan 2007) | 12 lines
  
  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/branches/qpid.0-9/   (props changed)
    incubator/qpid/branches/qpid.0-9/cpp/lib/broker/AccumulatedAck.h
    incubator/qpid/branches/qpid.0-9/cpp/lib/broker/BrokerChannel.cpp
    incubator/qpid/branches/qpid.0-9/cpp/tests/AccumulatedAckTest.cpp
    incubator/qpid/branches/qpid.0-9/cpp/tests/TxAckTest.cpp

Propchange: incubator/qpid/branches/qpid.0-9/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Tue Mar 13 13:14:31 2007
@@ -1 +1 @@
-/incubator/qpid/trunk/qpid:1-492620,492636,492641,492756,493126-493151,494540,494553,494587,495629,495661
+/incubator/qpid/trunk/qpid:1-492620,492636,492641,492756,493126-493151,494540,494553,494587,495629,495661,496317

Modified: incubator/qpid/branches/qpid.0-9/cpp/lib/broker/AccumulatedAck.h
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/qpid.0-9/cpp/lib/broker/AccumulatedAck.h?view=diff&rev=517849&r1=517848&r2=517849
==============================================================================
--- incubator/qpid/branches/qpid.0-9/cpp/lib/broker/AccumulatedAck.h (original)
+++ incubator/qpid/branches/qpid.0-9/cpp/lib/broker/AccumulatedAck.h Tue Mar 13 13:14:31 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 firstTag, u_int64_t lastTag);
             void consolidate();
             void clear();

Modified: incubator/qpid/branches/qpid.0-9/cpp/lib/broker/BrokerChannel.cpp
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/qpid.0-9/cpp/lib/broker/BrokerChannel.cpp?view=diff&rev=517849&r1=517848&r2=517849
==============================================================================
--- incubator/qpid/branches/qpid.0-9/cpp/lib/broker/BrokerChannel.cpp (original)
+++ incubator/qpid/branches/qpid.0-9/cpp/lib/broker/BrokerChannel.cpp Tue Mar 13 13:14:31 2007
@@ -60,6 +60,7 @@
     prefetchCount(0),
     framesize(_framesize),
     tagGenerator("sgen"),
+    accumulatedAck(0),
     store(_store),
     messageBuilder(this, _store, _stagingThreshold),
     opened(id == 0),//channel 0 is automatically open, other must be explicitly opened

Modified: incubator/qpid/branches/qpid.0-9/cpp/tests/AccumulatedAckTest.cpp
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/qpid.0-9/cpp/tests/AccumulatedAckTest.cpp?view=diff&rev=517849&r1=517848&r2=517849
==============================================================================
--- incubator/qpid/branches/qpid.0-9/cpp/tests/AccumulatedAckTest.cpp (original)
+++ incubator/qpid/branches/qpid.0-9/cpp/tests/AccumulatedAckTest.cpp Tue Mar 13 13:14:31 2007
@@ -37,7 +37,7 @@
     public:
         void testGeneral()
         {
-            AccumulatedAck ack;
+            AccumulatedAck ack(0);
             ack.clear();
             ack.update(3,3);
             ack.update(7,7);
@@ -63,8 +63,7 @@
 
         void testCovers()
         {
-            AccumulatedAck ack;
-            ack.range = 5;
+            AccumulatedAck ack(5);
             ack.individual.push_back(7);
             ack.individual.push_back(9);
             
@@ -83,8 +82,7 @@
 
         void testUpdateAndConsolidate()
         {
-            AccumulatedAck ack;
-            ack.clear();
+            AccumulatedAck ack(0);
             ack.update(1, 1);
             ack.update(3, 3);
             ack.update(10, 10);

Modified: incubator/qpid/branches/qpid.0-9/cpp/tests/TxAckTest.cpp
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/qpid.0-9/cpp/tests/TxAckTest.cpp?view=diff&rev=517849&r1=517848&r2=517849
==============================================================================
--- incubator/qpid/branches/qpid.0-9/cpp/tests/TxAckTest.cpp (original)
+++ incubator/qpid/branches/qpid.0-9/cpp/tests/TxAckTest.cpp Tue Mar 13 13:14:31 2007
@@ -67,7 +67,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(