qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From acon...@apache.org
Subject [36/50] [abbrv] qpid-proton git commit: PROTON-1024: fix handling of disconnection for BlockingConnection
Date Fri, 23 Oct 2015 14:36:38 GMT
PROTON-1024: fix handling of disconnection for BlockingConnection


Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/d72f161d
Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/d72f161d
Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/d72f161d

Branch: refs/heads/go1
Commit: d72f161d1d19aad55622adb6469a98ab9f396c1a
Parents: e547d13
Author: Gordon Sim <gsim@redhat.com>
Authored: Tue Oct 20 18:15:08 2015 +0100
Committer: Gordon Sim <gsim@redhat.com>
Committed: Tue Oct 20 18:15:33 2015 +0100

----------------------------------------------------------------------
 proton-c/bindings/python/proton/utils.py | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/d72f161d/proton-c/bindings/python/proton/utils.py
----------------------------------------------------------------------
diff --git a/proton-c/bindings/python/proton/utils.py b/proton-c/bindings/python/proton/utils.py
index 3682455..7421a21 100644
--- a/proton-c/bindings/python/proton/utils.py
+++ b/proton-c/bindings/python/proton/utils.py
@@ -249,7 +249,7 @@ class BlockingConnection(Handler):
                 self.container.timeout = container_timeout
         if self.disconnected or self._is_closed():
             self.container.stop()
-        if self.disconnected:
+        if self.disconnected and not self._is_closed():
             raise ConnectionException("Connection %s disconnected" % self.url)
 
     def on_link_remote_close(self, event):
@@ -265,9 +265,11 @@ class BlockingConnection(Handler):
     def on_transport_tail_closed(self, event):
         self.on_transport_closed(event)
 
+    def on_transport_head_closed(self, event):
+        self.on_transport_closed(event)
+
     def on_transport_closed(self, event):
-        if event.connection.state & Endpoint.LOCAL_ACTIVE:
-            self.disconnected = True
+        self.disconnected = True
 
 class AtomicCount(object):
     def __init__(self, start=0, step=1):


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


Mime
View raw message