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
commitdf9eb5f63c04baa2f5c7ecec61635537f64d9013 (patch)
treed294849abf8ef8fa71d8d04d8f183a160f1b50fd
parentc3227b42dd6ac22aa0829c910e842a7fd0eb14c2 (diff)
downloadqpid-python-df9eb5f63c04baa2f5c7ecec61635537f64d9013.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@1683708 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--qpid/python/qpid/client.py8
1 files changed, 8 insertions, 0 deletions
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