From ecde9757abc26697220e00d3306a11919f2fe2ca Mon Sep 17 00:00:00 2001 From: Gordon Sim Date: Wed, 25 Feb 2009 15:46:04 +0000 Subject: Fix for bug in credit reallocation, along with test from rafaels@redhat.com that reproduces it. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@747833 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/src/qpid/broker/SemanticState.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'cpp') diff --git a/cpp/src/qpid/broker/SemanticState.cpp b/cpp/src/qpid/broker/SemanticState.cpp index 4f751e43b7..ed6c2dc386 100644 --- a/cpp/src/qpid/broker/SemanticState.cpp +++ b/cpp/src/qpid/broker/SemanticState.cpp @@ -516,14 +516,16 @@ void SemanticState::ConsumerImpl::setCreditMode() void SemanticState::ConsumerImpl::addByteCredit(uint32_t value) { if (byteCredit != 0xFFFFFFFF) { - byteCredit += value; + if (value == 0xFFFFFFFF) byteCredit = value; + else byteCredit += value; } } void SemanticState::ConsumerImpl::addMessageCredit(uint32_t value) { if (msgCredit != 0xFFFFFFFF) { - msgCredit += value; + if (value == 0xFFFFFFFF) msgCredit = value; + else msgCredit += value; } } -- cgit v1.2.1