summaryrefslogtreecommitdiff
path: root/controller/JSONDB.cpp
diff options
context:
space:
mode:
authorGrant Limberg <grant.limberg@zerotier.com>2017-10-02 15:52:57 -0700
committerGrant Limberg <grant.limberg@zerotier.com>2017-10-02 15:52:57 -0700
commitb1d60df44cb24589bc5718da932ef4bb54168fa3 (patch)
treec240b5b626f534f4a3673bedbdf6d80b59a8d475 /controller/JSONDB.cpp
parent7cf70d111ac3bfc1bf6aa7e3ec8d9c83e35f48a1 (diff)
downloadinfinitytier-b1d60df44cb24589bc5718da932ef4bb54168fa3.tar.gz
infinitytier-b1d60df44cb24589bc5718da932ef4bb54168fa3.zip
timestamps changed from uint64_t to int64_t
There were cases in the code where time calculations and comparisons were overflowing and causing connection instability. This will keep time calculations within expected ranges.
Diffstat (limited to 'controller/JSONDB.cpp')
-rw-r--r--controller/JSONDB.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/controller/JSONDB.cpp b/controller/JSONDB.cpp
index f362acf3..67b13393 100644
--- a/controller/JSONDB.cpp
+++ b/controller/JSONDB.cpp
@@ -323,7 +323,7 @@ void JSONDB::threadMain()
_networks_m.unlock();
}
- const uint64_t now = OSUtils::now();
+ const int64_t now = OSUtils::now();
try {
Mutex::Lock _l(_networks_m);
for(std::vector<uint64_t>::iterator ii(todo.begin());ii!=todo.end();++ii) {
@@ -373,7 +373,7 @@ void JSONDB::threadMain()
} catch ( ... ) {}
} else {
try {
- ns.mostRecentDeauthTime = std::max(ns.mostRecentDeauthTime,OSUtils::jsonInt(member["lastDeauthorizedTime"],0ULL));
+ ns.mostRecentDeauthTime = std::max(ns.mostRecentDeauthTime,(int64_t)OSUtils::jsonInt(member["lastDeauthorizedTime"],0LL));
} catch ( ... ) {}
}
++ns.totalMemberCount;