summaryrefslogtreecommitdiff
path: root/node/Node.cpp
diff options
context:
space:
mode:
authorAdam Ierymenko <adam.ierymenko@gmail.com>2019-03-14 16:40:22 -0700
committerAdam Ierymenko <adam.ierymenko@gmail.com>2019-03-14 16:40:22 -0700
commit087c75d5eebea46be5a877dbd22c2362ad0a9051 (patch)
tree008de7a41f04929756121d2903dda350bd324389 /node/Node.cpp
parente03102dbcb4d28cfa54740a8d9824d3c6324d97b (diff)
downloadinfinitytier-087c75d5eebea46be5a877dbd22c2362ad0a9051.tar.gz
infinitytier-087c75d5eebea46be5a877dbd22c2362ad0a9051.zip
More cleanup.
Diffstat (limited to 'node/Node.cpp')
-rw-r--r--node/Node.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/node/Node.cpp b/node/Node.cpp
index 1a1f903d..54cbd503 100644
--- a/node/Node.cpp
+++ b/node/Node.cpp
@@ -281,6 +281,19 @@ ZT_ResultCode Node::processBackgroundTasks(void *tptr,int64_t now,volatile int64
}
}
+ // Clean up any old local controller auth memorizations.
+ {
+ _localControllerAuthorizations_m.lock();
+ Hashtable< _LocalControllerAuth,int64_t >::Iterator i(_localControllerAuthorizations);
+ _LocalControllerAuth *k = (_LocalControllerAuth *)0;
+ int64_t *v = (int64_t *)0;
+ while (i.next(k,v)) {
+ if ((*v - now) > (ZT_NETWORK_AUTOCONF_DELAY * 3))
+ _localControllerAuthorizations.erase(*k);
+ }
+ _localControllerAuthorizations_m.unlock();
+ }
+
// Get peers we should stay connected to according to network configs
// Also get networks and whether they need config so we only have to do one pass over networks
std::vector< std::pair< SharedPtr<Network>,bool > > networkConfigNeeded;