qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From g...@apache.org
Subject svn commit: r1480236 - in /qpid/trunk/qpid/cpp/src: qpid/broker/Message.cpp qpid/broker/Message.h qpid/messaging/amqp/EncodedMessage.cpp tests/qpid-receive.cpp
Date Wed, 08 May 2013 11:55:38 GMT
Author: gsim
Date: Wed May  8 11:55:37 2013
New Revision: 1480236

URL: http://svn.apache.org/r1480236
Log:
QPID-4668: Correct use of delivery count (should be 0 on first delivery)

Modified:
    qpid/trunk/qpid/cpp/src/qpid/broker/Message.cpp
    qpid/trunk/qpid/cpp/src/qpid/broker/Message.h
    qpid/trunk/qpid/cpp/src/qpid/messaging/amqp/EncodedMessage.cpp
    qpid/trunk/qpid/cpp/src/tests/qpid-receive.cpp

Modified: qpid/trunk/qpid/cpp/src/qpid/broker/Message.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/broker/Message.cpp?rev=1480236&r1=1480235&r2=1480236&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/broker/Message.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/broker/Message.cpp Wed May  8 11:55:37 2013
@@ -40,9 +40,9 @@ using std::string;
 namespace qpid {
 namespace broker {
 
-Message::Message() : deliveryCount(0), publisher(0), expiration(FAR_FUTURE), timestamp(0),
isManagementMessage(false) {}
+Message::Message() : deliveryCount(-1), publisher(0), expiration(FAR_FUTURE), timestamp(0),
isManagementMessage(false) {}
 Message::Message(boost::intrusive_ptr<Encoding> e, boost::intrusive_ptr<PersistableMessage>
p)
-    : encoding(e), persistentContext(p), deliveryCount(0), publisher(0), expiration(FAR_FUTURE),
timestamp(0), isManagementMessage(false)
+    : encoding(e), persistentContext(p), deliveryCount(-1), publisher(0), expiration(FAR_FUTURE),
timestamp(0), isManagementMessage(false)
 {
     if (persistentContext) persistentContext->setIngressCompletion(e);
 }

Modified: qpid/trunk/qpid/cpp/src/qpid/broker/Message.h
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/broker/Message.h?rev=1480236&r1=1480235&r2=1480236&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/broker/Message.h (original)
+++ qpid/trunk/qpid/cpp/src/qpid/broker/Message.h Wed May  8 11:55:37 2013
@@ -70,11 +70,11 @@ public:
     QPID_BROKER_EXTERN Message();
     QPID_BROKER_EXTERN ~Message();
 
-    bool isRedelivered() const { return deliveryCount > 1; }
+    bool isRedelivered() const { return deliveryCount; }
     void deliver() { ++deliveryCount; }
     void undeliver() { --deliveryCount; }
     int getDeliveryCount() const { return deliveryCount; }
-    void resetDeliveryCount() { deliveryCount = 0; }
+    void resetDeliveryCount() { deliveryCount = -1; }
 
     const ConnectionToken* getPublisher() const {  return publisher; }
     void setPublisher(ConnectionToken* p) {  publisher = p; }

Modified: qpid/trunk/qpid/cpp/src/qpid/messaging/amqp/EncodedMessage.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/messaging/amqp/EncodedMessage.cpp?rev=1480236&r1=1480235&r2=1480236&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/messaging/amqp/EncodedMessage.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/messaging/amqp/EncodedMessage.cpp Wed May  8 11:55:37 2013
@@ -228,7 +228,7 @@ void EncodedMessage::InitialScan::onTtl(
 void EncodedMessage::InitialScan::onFirstAcquirer(bool b) { em.firstAcquirer = b; }
 void EncodedMessage::InitialScan::onDeliveryCount(uint32_t i)
 {
-    mi.setRedelivered(i > 1);
+    mi.setRedelivered(i);
     em.deliveryCount = i;
 }
 

Modified: qpid/trunk/qpid/cpp/src/tests/qpid-receive.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/tests/qpid-receive.cpp?rev=1480236&r1=1480235&r2=1480236&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/tests/qpid-receive.cpp (original)
+++ qpid/trunk/qpid/cpp/src/tests/qpid-receive.cpp Wed May  8 11:55:37 2013
@@ -271,7 +271,7 @@ int main(int argc, char ** argv)
                 } else {
                     session.commit();
                 }
-            } else {
+            } else if (opts.ackFrequency) {
                 session.acknowledge();
             }
             session.close();



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


Mime
View raw message