qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From g...@apache.org
Subject svn commit: r890721 - in /qpid/trunk/qpid/cpp/src/qpid/broker: DeliveryRecord.cpp SemanticState.cpp
Date Tue, 15 Dec 2009 09:50:30 GMT
Author: gsim
Date: Tue Dec 15 09:50:30 2009
New Revision: 890721

URL: http://svn.apache.org/viewvc?rev=890721&view=rev
Log:
QPID-2089: Dequeue on acquire for accept mode NONE

Modified:
    qpid/trunk/qpid/cpp/src/qpid/broker/DeliveryRecord.cpp
    qpid/trunk/qpid/cpp/src/qpid/broker/SemanticState.cpp

Modified: qpid/trunk/qpid/cpp/src/qpid/broker/DeliveryRecord.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/broker/DeliveryRecord.cpp?rev=890721&r1=890720&r2=890721&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/broker/DeliveryRecord.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/broker/DeliveryRecord.cpp Tue Dec 15 09:50:30 2009
@@ -43,7 +43,7 @@
                                                   acceptExpected(!accepted),
                                                   cancelled(false),
                                                   completed(false),
-                                                  ended(accepted),
+                                                  ended(accepted && acquired),
                                                   windowing(_windowing),
                                                   credit(msg.payload ? msg.payload->getRequiredCredit()
: _credit)
 {}
@@ -150,6 +150,10 @@
     if (queue->acquire(msg)) {
         acquired = true;
         results.push_back(id);
+        if (!acceptExpected) {
+            if (ended) { QPID_LOG(error, "Can't dequeue ended message"); }
+            else { queue->dequeue(0, msg); setEnded(); }
+        }
     } else {
         QPID_LOG(info, "Message already acquired " << id.getValue());
     }

Modified: qpid/trunk/qpid/cpp/src/qpid/broker/SemanticState.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/broker/SemanticState.cpp?rev=890721&r1=890720&r2=890721&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/broker/SemanticState.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/broker/SemanticState.cpp Tue Dec 15 09:50:30 2009
@@ -311,7 +311,7 @@
     bool sync = syncFrequency && ++deliveryCount >= syncFrequency;
     if (sync) deliveryCount = 0;//reset
     parent->deliver(record, sync);
-    if (!ackExpected) record.setEnded();//allows message to be released now its been delivered
+    if (!ackExpected && acquire) record.setEnded();//allows message to be released
now its been delivered
     if (windowing || ackExpected || !acquire) {
         parent->record(record);
     } 



---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:commits-subscribe@qpid.apache.org


Mime
View raw message