summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/cluster/WriteEstimate.cpp
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2008-12-19 17:22:52 +0000
committerAlan Conway <aconway@apache.org>2008-12-19 17:22:52 +0000
commit7540027fdc97962e97a69f775aceca7f80f67f33 (patch)
treee46e3cd482abe01c99aa6c9dc343b4d94b978399 /cpp/src/qpid/cluster/WriteEstimate.cpp
parentfe1c7af8fb35c0cca7ffbb88d581b795850cdde8 (diff)
downloadqpid-python-7540027fdc97962e97a69f775aceca7f80f67f33.tar.gz
cluster: Increase initial estimate controlling writes.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@728072 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/cluster/WriteEstimate.cpp')
-rw-r--r--cpp/src/qpid/cluster/WriteEstimate.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/cpp/src/qpid/cluster/WriteEstimate.cpp b/cpp/src/qpid/cluster/WriteEstimate.cpp
index 81131be437..4d840947f3 100644
--- a/cpp/src/qpid/cluster/WriteEstimate.cpp
+++ b/cpp/src/qpid/cluster/WriteEstimate.cpp
@@ -27,7 +27,7 @@ namespace qpid {
namespace cluster {
WriteEstimate::WriteEstimate(size_t initial)
- : growing(true), estimate(initial) {}
+ : growing(true), estimate(initial), lastEstimate(initial) {}
size_t WriteEstimate::sending(size_t buffered) {
// We want to send a doOutput request for enough data such
@@ -42,7 +42,8 @@ size_t WriteEstimate::sending(size_t buffered) {
size_t pad(size_t value) { return value + value/2; }
-void WriteEstimate::delivered(size_t sent, size_t buffered) {
+void WriteEstimate::delivered(size_t last, size_t sent, size_t buffered) {
+ lastEstimate = last;
size_t wrote = sent > buffered ? sent - buffered : 0;
if (wrote == 0) // No change
return;