diff options
author | Adam Ierymenko <adam.ierymenko@gmail.com> | 2016-09-29 14:48:39 -0700 |
---|---|---|
committer | Adam Ierymenko <adam.ierymenko@gmail.com> | 2016-09-29 14:48:39 -0700 |
commit | 2fc3d12fb66d94387d537c4d2c4c1e7a7ca4beeb (patch) | |
tree | 213012bdfda8de8ee2f602a511e6426cbcee6b98 /controller | |
parent | 4fe9a4fe8376237ffba684a3e0be2edb14527fe1 (diff) | |
download | infinitytier-2fc3d12fb66d94387d537c4d2c4c1e7a7ca4beeb.tar.gz infinitytier-2fc3d12fb66d94387d537c4d2c4c1e7a7ca4beeb.zip |
Minor tweaks to member code in controller, and fix Linux build.
Diffstat (limited to 'controller')
-rw-r--r-- | controller/EmbeddedNetworkController.cpp | 7 | ||||
-rw-r--r-- | controller/EmbeddedNetworkController.hpp | 4 |
2 files changed, 5 insertions, 6 deletions
diff --git a/controller/EmbeddedNetworkController.cpp b/controller/EmbeddedNetworkController.cpp index cd8ce8bf..a93aa027 100644 --- a/controller/EmbeddedNetworkController.cpp +++ b/controller/EmbeddedNetworkController.cpp @@ -1004,12 +1004,7 @@ unsigned int EmbeddedNetworkController::handleControlPlaneHttpGET( if (!member.size()) return 404; - char addrs[24]; - Utils::snprintf(addrs,sizeof(addrs),"%.10llx",address); - - // Add non-persisted fields - member["clock"] = OSUtils::now(); - + _addMemberNonPersistedFields(member,now); responseBody = member.dump(2); responseContentType = "application/json"; diff --git a/controller/EmbeddedNetworkController.hpp b/controller/EmbeddedNetworkController.hpp index 1bfd9577..78d65c3a 100644 --- a/controller/EmbeddedNetworkController.hpp +++ b/controller/EmbeddedNetworkController.hpp @@ -181,6 +181,10 @@ private: network["activeMemberCount"] = nmi.activeMemberCount; network["totalMemberCount"] = nmi.totalMemberCount; } + inline void _addMemberNonPersistedFields(nlohmann::json &member,uint64_t now) + { + member["clock"] = now; + } // These are const after construction Node *const _node; |