summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/lbtest.cc9
-rw-r--r--src/lbtest.hh2
2 files changed, 8 insertions, 3 deletions
diff --git a/src/lbtest.cc b/src/lbtest.cc
index 8dd2f24..a45d48f 100644
--- a/src/lbtest.cc
+++ b/src/lbtest.cc
@@ -185,8 +185,13 @@ LBTest::recv(LBHealth &health)
else {
secs = recv_time.tv_sec - send_time.tv_sec;
}
+
+ if (_debug) {
+ printf("LBTest::recv(): usecs: %d, secs: %d\n",msecs,secs);
+ }
+
//time in milliseconds below
- r_iter->second._rtt = abs(msecs) / 1000 + 1000 * secs;
+ r_iter->second._rtt = (abs(msecs) / 1000) + 1000 * secs;
--pending_result_ct;
}
}
@@ -201,7 +206,7 @@ LBTest::recv(LBHealth &health)
while (r_iter != _results.end()) {
if (r_iter->second._iface == health._interface) {
- if (r_iter->second._rtt < _resp_time && r_iter->second._rtt >= 0) {
+ if (r_iter->second._rtt >= 0 && r_iter->second._rtt < _resp_time) {
_state = LBTest::K_SUCCESS;
if (_debug) {
cout << "LBTest::recv(): success for " << r_iter->second._iface << " : " << r_iter->second._rtt << endl;
diff --git a/src/lbtest.hh b/src/lbtest.hh
index 1fc7f07..208adaa 100644
--- a/src/lbtest.hh
+++ b/src/lbtest.hh
@@ -41,7 +41,7 @@ public:
public:
LBTest(bool debug) :
_debug(debug),
- _resp_time(5),
+ _resp_time(5*1000),
_state(K_NONE)
{init();}