activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r1099540 - /activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQConsumer.cpp
Date Wed, 04 May 2011 17:51:57 GMT
Author: tabish
Date: Wed May  4 17:51:57 2011
New Revision: 1099540

URL: http://svn.apache.org/viewvc?rev=1099540&view=rev
Log:
Fix possible double ack message being fired.

Modified:
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQConsumer.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=1099540&r1=1099539&r2=1099540&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 Wed
May  4 17:51:57 2011
@@ -790,18 +790,11 @@ void ActiveMQConsumer::afterMessageIsCon
         } else if( isAutoAcknowledgeBatch() ) {
             ackLater( message, ActiveMQConstants::ACK_TYPE_CONSUMED );
         } else if( session->isClientAcknowledge() || session->isIndividualAcknowledge()
) {
-            ackLater( message, ActiveMQConstants::ACK_TYPE_DELIVERED );
 
             bool messageUnackedByConsumer = false;
 
             synchronized( &this->internal->dispatchedMessages ) {
-                std::auto_ptr< Iterator< Pointer<MessageDispatch> > > iter(
this->internal->dispatchedMessages.iterator() );
-                while( iter->hasNext() ) {
-                    if( iter->next() == message ) {
-                        messageUnackedByConsumer = true;
-                        break;
-                    }
-                }
+                messageUnackedByConsumer = this->internal->dispatchedMessages.contains(message);
             }
 
             if( messageUnackedByConsumer ) {



Mime
View raw message