summaryrefslogtreecommitdiff
path: root/python/qpid/messaging.py
diff options
context:
space:
mode:
authorRafael H. Schloming <rhs@apache.org>2009-08-27 16:04:37 +0000
committerRafael H. Schloming <rhs@apache.org>2009-08-27 16:04:37 +0000
commit506f66ac156140970b88592d19364d114fce5e78 (patch)
tree2c428da9591aa47e2668f225f228dd37093d2f17 /python/qpid/messaging.py
parent6579816b73d7bde5b0f206cb0cef54eb50086d97 (diff)
downloadqpid-python-506f66ac156140970b88592d19364d114fce5e78.tar.gz
added an assertion to check that credit constraints are not violated, and corrected a bug in a wait condition
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@808475 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'python/qpid/messaging.py')
-rw-r--r--python/qpid/messaging.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/python/qpid/messaging.py b/python/qpid/messaging.py
index 3c41a2c417..de6063e684 100644
--- a/python/qpid/messaging.py
+++ b/python/qpid/messaging.py
@@ -701,7 +701,7 @@ class Receiver(Lockable):
if self._capacity() == 0:
self.granted = self.returned + 1
self.wakeup()
- self.ewait(lambda: self.impending == self.granted)
+ self.ewait(lambda: self.impending >= self.granted)
msg = self.session._get(self._pred, timeout=timeout)
if msg is None:
self.drain = True
@@ -1202,6 +1202,8 @@ class Driver(Lockable):
msg = self._decode(m)
rcv = ssn.receivers[int(cmd.destination)]
msg._receiver = rcv
+ if rcv.impending is not UNLIMITED:
+ assert rcv.received < rcv.impending
rcv.received += 1
log.debug("RECV [%s] %s", ssn, msg)
ssn.incoming.append(msg)