summaryrefslogtreecommitdiff
path: root/controller
diff options
context:
space:
mode:
authorAdam Ierymenko <adam.ierymenko@gmail.com>2017-05-02 10:34:33 -0700
committerAdam Ierymenko <adam.ierymenko@gmail.com>2017-05-02 10:34:33 -0700
commit132643cd4ae03e00e44ab8779ac2779b400fbf25 (patch)
tree6f2f08d6e1fdf14a4b64c9526b71f7fea4240edb /controller
parentfaf7b81c0173149230bc562ecf09b488f03af02e (diff)
downloadinfinitytier-132643cd4ae03e00e44ab8779ac2779b400fbf25.tar.gz
infinitytier-132643cd4ae03e00e44ab8779ac2779b400fbf25.zip
Fix small issue preventing pongs if there are never seen members.
Diffstat (limited to 'controller')
-rw-r--r--controller/EmbeddedNetworkController.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/controller/EmbeddedNetworkController.cpp b/controller/EmbeddedNetworkController.cpp
index 9ffc0ea2..9bcddac8 100644
--- a/controller/EmbeddedNetworkController.cpp
+++ b/controller/EmbeddedNetworkController.cpp
@@ -1058,12 +1058,15 @@ unsigned int EmbeddedNetworkController::handleControlPlaneHttpPOST(
Mutex::Lock _l(_memberStatus_m);
_db.eachId([this,&pong,&now,&first](uint64_t networkId,uint64_t nodeId) {
char tmp[64];
+ uint64_t lrt = 0ULL;
auto ms = this->_memberStatus.find(_MemberStatusKey(networkId,nodeId));
+ if (ms != _memberStatus.end())
+ lrt = ms->second.lastRequestTime;
Utils::snprintf(tmp,sizeof(tmp),"%s\"%.16llx-%.10llx\":%llu",
(first) ? "" : ",",
(unsigned long long)networkId,
(unsigned long long)nodeId,
- (ms != _memberStatus.end()) ? (unsigned long long)ms->second.lastRequestTime : 0ULL);
+ (unsigned long long)lrt);
pong.append(tmp);
first = false;
});