Author: aconway
Date: Mon Dec 8 04:00:58 2008
New Revision: 724326
URL: http://svn.apache.org/viewvc?rev=724326&view=rev
Log:
Cluster: fixed error in credit allocation.
Modified:
incubator/qpid/trunk/qpid/cpp/src/qpid/cluster/Connection.cpp
incubator/qpid/trunk/qpid/cpp/src/qpid/cluster/OutputInterceptor.cpp
Modified: incubator/qpid/trunk/qpid/cpp/src/qpid/cluster/Connection.cpp
URL:
http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/qpid/cluster/Connection.cpp?rev=724326&r1=724325&r2=724326&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/qpid/cluster/Connection.cpp (original)
+++ incubator/qpid/trunk/qpid/cpp/src/qpid/cluster/Connection.cpp Mon Dec 8
04:00:58 2008
@@ -75,7 +75,7 @@
QPID_LOG(debug, cluster << " new connection: " << *this);
if (isLocal() && !isCatchUp()) {
// FIXME aconway 2008-12-05: configurable credit limit
- output.giveReadCredit(3);
+ output.giveReadCredit(10);
}
}
@@ -91,7 +91,7 @@
// which stocks up the write buffers with data.
//
void Connection::deliverDoOutput(uint32_t requested) {
- assert(!catchUp);
+
output.deliverDoOutput(requested);
}
@@ -191,7 +191,6 @@
Buffer buf(const_cast<char*>(buffer), size);
while (localDecoder.decode(buf))
received(localDecoder.frame);
- output.giveReadCredit(1);
}
else { // Multicast local connections.
assert(isLocal());
@@ -205,8 +204,7 @@
++deliverSeq;
while (mcastDecoder.decode(buf))
delivered(mcastDecoder.frame);
- if (isLocal())
- output.giveReadCredit(1);
+ output.giveReadCredit(1);
}
broker::SessionState& Connection::sessionState() {
Modified: incubator/qpid/trunk/qpid/cpp/src/qpid/cluster/OutputInterceptor.cpp
URL:
http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/qpid/cluster/OutputInterceptor.cpp?rev=724326&r1=724325&r2=724326&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/qpid/cluster/OutputInterceptor.cpp
(original)
+++ incubator/qpid/trunk/qpid/cpp/src/qpid/cluster/OutputInterceptor.cpp Mon
Dec 8 04:00:58 2008
@@ -76,10 +76,12 @@
// Run the real doOutput() till we have added the requested data or
there's nothing to output.
sent = 0;
+ {
+ sys::Mutex::ScopedUnlock u(lock);
do {
- sys::Mutex::ScopedUnlock u(lock);
moreOutput = parent.getBrokerConnection().doOutput();
} while (sent < requested && moreOutput);
+ }
sent += buf; // Include buffered data in the sent total.
QPID_LOG(trace, "Delivered doOutput: requested=" << requested << "
output=" << sent << " more=" << moreOutput);