summaryrefslogtreecommitdiff
path: root/cpp/src
diff options
context:
space:
mode:
authorPavel Moravec <pmoravec@apache.org>2014-07-03 08:15:04 +0000
committerPavel Moravec <pmoravec@apache.org>2014-07-03 08:15:04 +0000
commitc72cd40c12623140883ee447573b138c80278c80 (patch)
tree0994bbadb9a6eedc360f481fd0db2c05f07819a9 /cpp/src
parent94575fe3ca1609a919d88802aaaf58b7454fa48b (diff)
downloadqpid-python-c72cd40c12623140883ee447573b138c80278c80.tar.gz
[QPID-5866]: [C++ client] AMQP 1.0 closing session without closing receiver first marks further messages as redelivered
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1607562 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src')
-rw-r--r--cpp/src/qpid/messaging/amqp/ConnectionContext.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/cpp/src/qpid/messaging/amqp/ConnectionContext.cpp b/cpp/src/qpid/messaging/amqp/ConnectionContext.cpp
index e8b0c6c18e..d29b2eae6f 100644
--- a/cpp/src/qpid/messaging/amqp/ConnectionContext.cpp
+++ b/cpp/src/qpid/messaging/amqp/ConnectionContext.cpp
@@ -139,6 +139,14 @@ void ConnectionContext::endSession(boost::shared_ptr<SessionContext> ssn)
{
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");