You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by gs...@apache.org on 2015/10/20 19:23:06 UTC

qpid-proton git commit: PROTON-1024: fix handling of disconnection for BlockingConnection

Repository: qpid-proton
Updated Branches:
  refs/heads/master e547d134e -> d72f161d1


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/master
Commit: d72f161d1d19aad55622adb6469a98ab9f396c1a
Parents: e547d13
Author: Gordon Sim <gs...@redhat.com>
Authored: Tue Oct 20 18:15:08 2015 +0100
Committer: Gordon Sim <gs...@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