summaryrefslogtreecommitdiff
path: root/src/lbdata.cc
diff options
context:
space:
mode:
authorMichael Larson <slioch@eng-140.vyatta.com>2008-02-04 16:45:08 -0800
committerMichael Larson <slioch@eng-140.vyatta.com>2008-02-04 16:45:08 -0800
commit6fc0de67999f8d8fee10ea7e95ac5601bcb5ff36 (patch)
tree866acd3d869af8af46b4352ddb7714e7fbbbe1f6 /src/lbdata.cc
parente357cbea7769efed1fe897dd800507bc55a15231 (diff)
downloadvyatta-wanloadbalance-6fc0de67999f8d8fee10ea7e95ac5601bcb5ff36.tar.gz
vyatta-wanloadbalance-6fc0de67999f8d8fee10ea7e95ac5601bcb5ff36.zip
whole raft of cli related changes. Fixed bugs in display output--added error checking on some configuration combinations. added
additional error checking in the code.
Diffstat (limited to 'src/lbdata.cc')
-rw-r--r--src/lbdata.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/lbdata.cc b/src/lbdata.cc
index 14a04c0..57050d2 100644
--- a/src/lbdata.cc
+++ b/src/lbdata.cc
@@ -67,6 +67,7 @@ LBHealth::put(int rtt)
LBHealthHistory::LBHealthHistory(int buffer_size) :
_last_success(0),
_last_failure(0),
+ _failure_count(0),
_index(0)
{
_resp_data.resize(10);
@@ -90,8 +91,10 @@ LBHealthHistory::push(int rtt)
if (rtt == -1) {
_last_failure = tv.tv_sec;
+ ++_failure_count;
}
else {
+ _failure_count = 0;
_last_success = tv.tv_sec;
}
@@ -115,9 +118,10 @@ LBHealthHistory::push(int rtt)
++ct;
}
else {
- return ct;
+ break;
}
}
+
return ct;
}