activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nmitt...@apache.org
Subject svn commit: r468738 - /incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/stomp/commands/AckCommand.h
Date Sat, 28 Oct 2006 21:02:50 GMT
Author: nmittler
Date: Sat Oct 28 14:02:50 2006
New Revision: 468738

URL: http://svn.apache.org/viewvc?view=rev&rev=468738
Log:
AMQ-1011 - fixing empty if clause in ACK command

Modified:
    incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/stomp/commands/AckCommand.h

Modified: incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/stomp/commands/AckCommand.h
URL: http://svn.apache.org/viewvc/incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/stomp/commands/AckCommand.h?view=diff&rev=468738&r1=468737&r2=468738
==============================================================================
--- incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/stomp/commands/AckCommand.h
(original)
+++ incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/stomp/commands/AckCommand.h
Sat Oct 28 14:02:50 2006
@@ -91,14 +91,21 @@
          */
         virtual bool validate( const StompFrame& frame ) const
         {
-            if((frame.getCommand() == 
-                CommandConstants::toString( CommandConstants::ACK )) &&
-               (frame.getProperties().hasProperty(
+            // Make sure the message is an ACK message.
+            bool isAck = frame.getCommand() == 
+                CommandConstants::toString( CommandConstants::ACK );
+                
+            // Make sure it has a transaction ID header.
+            bool hasTransactionId = frame.getProperties().hasProperty(
                    CommandConstants::toString( 
-                       CommandConstants::HEADER_TRANSACTIONID ) ) &&
-               (frame.getProperties().hasProperty(
+                       CommandConstants::HEADER_TRANSACTIONID ) );
+                       
+            // Make sure it has a message ID header.
+            bool hasMessageId = frame.getProperties().hasProperty(
                    CommandConstants::toString( 
-                       CommandConstants::HEADER_MESSAGEID ) ) ) ) );
+                       CommandConstants::HEADER_MESSAGEID ) );
+            
+            if( isAck && hasTransactionId && hasMessageId )
             {
                 return true;
             }



Mime
View raw message