From df9eb5f63c04baa2f5c7ecec61635537f64d9013 Mon Sep 17 00:00:00 2001 From: Alex Rudyy Date: Fri, 5 Jun 2015 10:51:23 +0000 Subject: QPID-6567: [Python Client 0-8..0-91] send flow-ok on receiving flow command. work by Lorenz Quack git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1683708 13f79535-47bb-0310-9956-ffa450edef68 --- qpid/python/qpid/client.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'qpid/python') diff --git a/qpid/python/qpid/client.py b/qpid/python/qpid/client.py index 24b238f05e..3bbc097d25 100644 --- a/qpid/python/qpid/client.py +++ b/qpid/python/qpid/client.py @@ -208,7 +208,15 @@ class ClientDelegate(Delegate): ch.closed(msg) def channel_flow(self, ch, msg): + # On resuming we want to minimize the possibility of sending a message before flow-ok has been sent. + # Therefore, we send flow-ok before we set the flow_control flag. + if msg.active: + msg.flow_ok() ch.set_flow_control(not msg.active) + # On pausing we want to minimize the possibility of sending a message after flow-ok has been sent. + # Therefore, we send flow-ok after we set the flow_control flag. + if not msg.active: + msg.flow_ok() def session_ack(self, ch, msg): pass -- cgit v1.2.1