You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by pm...@apache.org on 2014/07/03 10:15:04 UTC

svn commit: r1607562 - /qpid/trunk/qpid/cpp/src/qpid/messaging/amqp/ConnectionContext.cpp

Author: pmoravec
Date: Thu Jul  3 08:15:04 2014
New Revision: 1607562

URL: http://svn.apache.org/r1607562
Log:
[QPID-5866]: [C++ client] AMQP 1.0 closing session without closing receiver first marks further messages as redelivered

Modified:
    qpid/trunk/qpid/cpp/src/qpid/messaging/amqp/ConnectionContext.cpp

Modified: qpid/trunk/qpid/cpp/src/qpid/messaging/amqp/ConnectionContext.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/messaging/amqp/ConnectionContext.cpp?rev=1607562&r1=1607561&r2=1607562&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/messaging/amqp/ConnectionContext.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/messaging/amqp/ConnectionContext.cpp Thu Jul  3 08:15:04 2014
@@ -139,6 +139,14 @@ void ConnectionContext::endSession(boost
 {
     qpid::sys::ScopedLock<qpid::sys::Monitor> l(lock);
     if (pn_session_state(ssn->session) & PN_REMOTE_ACTIVE) {
+        //explicitly release messages that have yet to be fetched
+        for (boost::shared_ptr<ReceiverContext> lnk = ssn->nextReceiver(); lnk != boost::shared_ptr<ReceiverContext>(); lnk = ssn->nextReceiver()) {
+            for (pn_delivery_t* d = pn_link_current(lnk->receiver); d; d = pn_link_current(lnk->receiver)) {
+                pn_link_advance(lnk->receiver);
+                pn_delivery_update(d, PN_RELEASED);
+                pn_delivery_settle(d);
+            }
+	}
         //wait for outstanding sends to settle
         while (!ssn->settled()) {
             QPID_LOG(debug, "Waiting for sends to settle before closing");



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