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 <g...@redhat.com> Authored: Tue Oct 20 18:15:08 2015 +0100 Committer: Gordon Sim <g...@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-unsubscr...@qpid.apache.org For additional commands, e-mail: commits-h...@qpid.apache.org