qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cctriel...@apache.org
Subject svn commit: r730031 - in /qpid/trunk/qpid/cpp/src: qpid/broker/Queue.cpp tests/QueueTest.cpp
Date Tue, 30 Dec 2008 02:32:22 GMT
Author: cctrieloff
Date: Mon Dec 29 18:32:22 2008
New Revision: 730031

URL: http://svn.apache.org/viewvc?rev=730031&view=rev
Log:
- browse correction, to update replacement message on browse
- correct stats for lvq messages


Modified:
    qpid/trunk/qpid/cpp/src/qpid/broker/Queue.cpp
    qpid/trunk/qpid/cpp/src/tests/QueueTest.cpp

Modified: qpid/trunk/qpid/cpp/src/qpid/broker/Queue.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/broker/Queue.cpp?rev=730031&r1=730030&r2=730031&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/broker/Queue.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/broker/Queue.cpp Mon Dec 29 18:32:22 2008
@@ -308,6 +308,10 @@
                 c->position = msg.position;
                 m = msg;
                 if (!lastValueQueueNoBrowse) clearLVQIndex(msg);
+                if (lastValueQueue) {
+                    boost::intrusive_ptr<Message> replacement = msg.payload->getReplacementMessage(this);
+                    if (replacement.get()) m.payload = replacement;
+                }
                 return true;
             } else {
                 //browser hasn't got enough credit for the message
@@ -511,6 +515,10 @@
                 lvq[key] = msg;
             }else {
                 i->second->setReplacementMessage(msg,this);
+                if (mgmtObject != 0) {
+                    mgmtObject->inc_msgTotalDequeues();
+                    mgmtObject->inc_byteTotalDequeues(msg->contentSize());
+                }
             }		 
         }else {
             messages.push_back(qm);

Modified: qpid/trunk/qpid/cpp/src/tests/QueueTest.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/tests/QueueTest.cpp?rev=730031&r1=730030&r2=730031&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/tests/QueueTest.cpp (original)
+++ qpid/trunk/qpid/cpp/src/tests/QueueTest.cpp Mon Dec 29 18:32:22 2008
@@ -417,6 +417,11 @@
     
     queue->deliver(msg6);
     BOOST_CHECK_EQUAL(queue->getMessageCount(), 3u);
+
+    intrusive_ptr<Message> received;
+    received = queue->get().payload;
+    BOOST_CHECK_EQUAL(msg4.get(), received.get());
+
 }
 
 QPID_AUTO_TEST_CASE(testLVQMultiQueue){



Mime
View raw message