diff options
| author | Pavel Moravec <pmoravec@apache.org> | 2014-07-03 08:15:04 +0000 |
|---|---|---|
| committer | Pavel Moravec <pmoravec@apache.org> | 2014-07-03 08:15:04 +0000 |
| commit | 0b84fbe843ec6b15bbf9bcf2e159a48328f4c2f4 (patch) | |
| tree | 117d895cb9e73b8a05aa7f11bc224858ce9c3bcd /qpid/cpp/src | |
| parent | 019efd3773a2f6986ef8eef3749ecb2dfbef2147 (diff) | |
| download | qpid-python-0b84fbe843ec6b15bbf9bcf2e159a48328f4c2f4.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@1607562 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/src')
| -rw-r--r-- | qpid/cpp/src/qpid/messaging/amqp/ConnectionContext.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/qpid/cpp/src/qpid/messaging/amqp/ConnectionContext.cpp b/qpid/cpp/src/qpid/messaging/amqp/ConnectionContext.cpp index e8b0c6c18e..d29b2eae6f 100644 --- a/qpid/cpp/src/qpid/messaging/amqp/ConnectionContext.cpp +++ b/qpid/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"); |
