summaryrefslogtreecommitdiff
path: root/qpid/python
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
commit44a66f59059fbbb4724c6bd70f63061ddd688405 (patch)
tree3c2e77b159eac8d23efdb61ad629eb8c23f511fe /qpid/python
parent74375b10e9c0011582ce52f8bbf2acc7a70ff869 (diff)
downloadqpid-python-44a66f59059fbbb4724c6bd70f63061ddd688405.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@808475 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/python')
-rw-r--r--qpid/python/qpid/messaging.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/qpid/python/qpid/messaging.py b/qpid/python/qpid/messaging.py
index 3c41a2c417..de6063e684 100644
--- a/qpid/python/qpid/messaging.py
+++ b/qpid/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)