diff options
| author | Gordon Sim <gsim@apache.org> | 2013-11-12 11:04:48 +0000 |
|---|---|---|
| committer | Gordon Sim <gsim@apache.org> | 2013-11-12 11:04:48 +0000 |
| commit | 25ad311c533822161c4ef88b770b805bc8207f86 (patch) | |
| tree | 95165717acc05fdbfe1267f2fc3dafc075925b3b /cpp/src | |
| parent | 3167b997315f13123e98c74d8a3a192ec01d3d3c (diff) | |
| download | qpid-python-25ad311c533822161c4ef88b770b805bc8207f86.tar.gz | |
QPID-5331: don't wait for settlement on closing session if link has already been closed
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1541001 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src')
| -rw-r--r-- | cpp/src/qpid/messaging/amqp/SenderContext.cpp | 5 | ||||
| -rw-r--r-- | cpp/src/qpid/messaging/amqp/SenderContext.h | 1 | ||||
| -rw-r--r-- | cpp/src/qpid/messaging/amqp/SessionContext.cpp | 2 |
3 files changed, 7 insertions, 1 deletions
diff --git a/cpp/src/qpid/messaging/amqp/SenderContext.cpp b/cpp/src/qpid/messaging/amqp/SenderContext.cpp index 6eed7b43d6..1f9d1d5723 100644 --- a/cpp/src/qpid/messaging/amqp/SenderContext.cpp +++ b/cpp/src/qpid/messaging/amqp/SenderContext.cpp @@ -575,6 +575,11 @@ bool SenderContext::settled() return processUnsettled(false) == 0; } +bool SenderContext::closed() +{ + return pn_link_state(sender) & PN_LOCAL_CLOSED; +} + Address SenderContext::getAddress() const { return address; diff --git a/cpp/src/qpid/messaging/amqp/SenderContext.h b/cpp/src/qpid/messaging/amqp/SenderContext.h index 27ffa1e81b..be050024f1 100644 --- a/cpp/src/qpid/messaging/amqp/SenderContext.h +++ b/cpp/src/qpid/messaging/amqp/SenderContext.h @@ -80,6 +80,7 @@ class SenderContext void verify(); void check(); bool settled(); + bool closed(); Address getAddress() const; private: friend class ConnectionContext; diff --git a/cpp/src/qpid/messaging/amqp/SessionContext.cpp b/cpp/src/qpid/messaging/amqp/SessionContext.cpp index e13ccdbc36..3d24380801 100644 --- a/cpp/src/qpid/messaging/amqp/SessionContext.cpp +++ b/cpp/src/qpid/messaging/amqp/SessionContext.cpp @@ -162,7 +162,7 @@ bool SessionContext::settled() bool result = true; for (SenderMap::iterator i = senders.begin(); i != senders.end(); ++i) { try { - if (!i->second->settled()) result = false; + if (!i->second->closed() && !i->second->settled()) result = false; } catch (const std::exception&) { senders.erase(i); throw; |
