summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Rudyy <orudyy@apache.org>2015-06-05 10:51:23 +0000
committerAlex Rudyy <orudyy@apache.org>2015-06-05 10:51:23 +0000
commitbb00e4692427d5e0a868874ace101cb8b770a612 (patch)
treefd0a28d5c53fcc18d6dc22ff04fd0ce79c473b01
parent9d6f87fbb579c12ed9749a5bee759076f9a97429 (diff)
downloadqpid-python-bb00e4692427d5e0a868874ace101cb8b770a612.tar.gz
QPID-6567: [Python Client 0-8..0-91] send flow-ok on receiving flow command. work by Lorenz Quack <quack.lorenz@gmail.com>
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1683708 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--python/qpid/client.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/python/qpid/client.py b/python/qpid/client.py
index 24b238f05e..3bbc097d25 100644
--- a/python/qpid/client.py
+++ b/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