summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGordon Sim <gsim@apache.org>2013-11-12 11:04:48 +0000
committerGordon Sim <gsim@apache.org>2013-11-12 11:04:48 +0000
commite9b7012316fb5b8cbac9ef79637638776e0ebccf (patch)
tree2eb3febf35890cd6a578dfd92f0a43c8c2babf83
parentda2b8cd2c3ef5fc9c7d58ad67a199c03a7d57680 (diff)
downloadqpid-python-e9b7012316fb5b8cbac9ef79637638776e0ebccf.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@1541001 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--qpid/cpp/src/qpid/messaging/amqp/SenderContext.cpp5
-rw-r--r--qpid/cpp/src/qpid/messaging/amqp/SenderContext.h1
-rw-r--r--qpid/cpp/src/qpid/messaging/amqp/SessionContext.cpp2
3 files changed, 7 insertions, 1 deletions
diff --git a/qpid/cpp/src/qpid/messaging/amqp/SenderContext.cpp b/qpid/cpp/src/qpid/messaging/amqp/SenderContext.cpp
index 6eed7b43d6..1f9d1d5723 100644
--- a/qpid/cpp/src/qpid/messaging/amqp/SenderContext.cpp
+++ b/qpid/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/qpid/cpp/src/qpid/messaging/amqp/SenderContext.h b/qpid/cpp/src/qpid/messaging/amqp/SenderContext.h
index 27ffa1e81b..be050024f1 100644
--- a/qpid/cpp/src/qpid/messaging/amqp/SenderContext.h
+++ b/qpid/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/qpid/cpp/src/qpid/messaging/amqp/SessionContext.cpp b/qpid/cpp/src/qpid/messaging/amqp/SessionContext.cpp
index e13ccdbc36..3d24380801 100644
--- a/qpid/cpp/src/qpid/messaging/amqp/SessionContext.cpp
+++ b/qpid/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;