From 44a66f59059fbbb4724c6bd70f63061ddd688405 Mon Sep 17 00:00:00 2001 From: "Rafael H. Schloming" Date: Thu, 27 Aug 2009 16:04:37 +0000 Subject: 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 --- qpid/python/qpid/messaging.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'qpid/python') 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) -- cgit v1.2.1