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/02/18 22:32:03 UTC

qpid-proton git commit: restore proper disconnect handling in BlockingConnection (was inadvertently broken by move to c-reactor)

Repository: qpid-proton
Updated Branches:
  refs/heads/master a041d644a -> ae49e3ac3


restore proper disconnect handling in BlockingConnection (was inadvertently broken by move to c-reactor)


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

Branch: refs/heads/master
Commit: ae49e3ac38aa259766d6c83e3d548c9e12b747d8
Parents: a041d64
Author: Gordon Sim <gs...@redhat.com>
Authored: Wed Feb 18 21:21:41 2015 +0000
Committer: Gordon Sim <gs...@redhat.com>
Committed: Wed Feb 18 21:26:16 2015 +0000

----------------------------------------------------------------------
 proton-c/bindings/python/proton/handlers.py | 3 +++
 proton-c/bindings/python/proton/utils.py    | 8 ++++++--
 2 files changed, 9 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/ae49e3ac/proton-c/bindings/python/proton/handlers.py
----------------------------------------------------------------------
diff --git a/proton-c/bindings/python/proton/handlers.py b/proton-c/bindings/python/proton/handlers.py
index 0c6cc05..e696c69 100644
--- a/proton-c/bindings/python/proton/handlers.py
+++ b/proton-c/bindings/python/proton/handlers.py
@@ -352,6 +352,9 @@ class EndpointStateHandler(Handler):
         elif self.peer_close_is_error:
             self.on_link_error(event)
 
+    def on_transport_tail_closed(self, event):
+        self.on_transport_closed(event)
+
     def on_transport_closed(self, event):
         if self.delegate:
             dispatch(self.delegate, 'on_disconnected', event)

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/ae49e3ac/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 b787ccf..00dedcb 100644
--- a/proton-c/bindings/python/proton/utils.py
+++ b/proton-c/bindings/python/proton/utils.py
@@ -245,8 +245,12 @@ class BlockingConnection(Handler):
             event.connection.close()
             raise ConnectionClosed(event.connection)
 
-    def on_disconnected(self, event):
-        raise ConnectionException("Connection %s disconnected" % self.url);
+    def on_transport_tail_closed(self, event):
+        self.on_transport_closed(event)
+
+    def on_transport_closed(self, event):
+        if event.connection.state & Endpoint.LOCAL_ACTIVE:
+            raise ConnectionException("Connection %s disconnected" % self.url);
 
 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