activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r773007 - in /activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq: core/ActiveMQConsumer.cpp wireformat/stomp/marshal/Marshaler.cpp
Date Fri, 08 May 2009 14:29:19 GMT
Author: tabish
Date: Fri May  8 14:29:18 2009
New Revision: 773007

URL: http://svn.apache.org/viewvc?rev=773007&view=rev
Log:
Minor touchups to ensure transactions keep delivery counters correctly.

Modified:
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQConsumer.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/stomp/marshal/Marshaler.cpp

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQConsumer.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQConsumer.cpp?rev=773007&r1=773006&r2=773007&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQConsumer.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQConsumer.cpp Fri
May  8 14:29:18 2009
@@ -606,7 +606,7 @@
         pendingAck->setTransactionId( this->transaction->getTransactionId() );
     }
 
-    if( ( 0.5 * this->consumerInfo->getPrefetchSize()) <= ( deliveredCounter - additionalWindowSize
) ) {
+    if( ( 0.5 * this->consumerInfo->getPrefetchSize() ) <= ( deliveredCounter -
additionalWindowSize ) ) {
         session->oneway( pendingAck );
         pendingAck.reset( NULL );
         additionalWindowSize = deliveredCounter;
@@ -681,9 +681,8 @@
             pendingAck.reset( NULL );
 
             // Adjust the counters
-            deliveredCounter -= (int)dispatchedMessages.size();
-            additionalWindowSize =
-                Math::max( 0, additionalWindowSize - (int)dispatchedMessages.size() );
+            deliveredCounter = Math::max( 0, deliveredCounter - dispatchedMessages.size());
+            additionalWindowSize = Math::max(0, additionalWindowSize - dispatchedMessages.size());
 
             if( !session->isTransacted() ) {
                 dispatchedMessages.clear();

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/stomp/marshal/Marshaler.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/stomp/marshal/Marshaler.cpp?rev=773007&r1=773006&r2=773007&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/stomp/marshal/Marshaler.cpp
(original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/stomp/marshal/Marshaler.cpp
Fri May  8 14:29:18 2009
@@ -282,7 +282,6 @@
                             helper.convertTransactionId( ack->getTransactionId() ) );
     }
 
-    //return Pointer<StompFrame>();
     return frame;
 }
 



Mime
View raw message