Repository: qpid-proton
Updated Branches:
  refs/heads/master 1455f3257 -> 92d049935


PROTON-825: BlockingReceiver.receive() does not respect it's timeout.


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

Branch: refs/heads/master
Commit: 92d049935fe0c9eb2ccc8430414c05ec12eefe94
Parents: 1455f32
Author: Alan Conway <acon...@redhat.com>
Authored: Mon Feb 23 17:15:35 2015 -0500
Committer: Alan Conway <acon...@redhat.com>
Committed: Mon Feb 23 17:15:35 2015 -0500

----------------------------------------------------------------------
 proton-c/bindings/python/proton/utils.py | 19 ++++++++++++-------
 1 file changed, 12 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/92d04993/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 c09330c..c15a77c 100644
--- a/proton-c/bindings/python/proton/utils.py
+++ b/proton-c/bindings/python/proton/utils.py
@@ -228,13 +228,18 @@ class BlockingConnection(Handler):
             while not condition():
                 self.container.process()
         else:
-            deadline = time.time() + timeout
-            while not condition():
-                self.container.process()
-                if deadline < time.time():
-                    txt = "Connection %s timed out" % self.url
-                    if msg: txt += ": " + msg
-                    raise Timeout(txt)
+            container_timeout = self.container.timeout
+            self.container.timeout = timeout
+            try:
+                deadline = time.time() + timeout
+                while not condition():
+                    self.container.process()
+                    if deadline < time.time():
+                        txt = "Connection %s timed out" % self.url
+                        if msg: txt += ": " + msg
+                        raise Timeout(txt)
+            finally:
+                self.container.timeout = container_timeout
 
     def on_link_remote_close(self, event):
         if event.link.state & Endpoint.LOCAL_ACTIVE:


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

Reply via email to