diff options
| author | Adam Ierymenko <adam.ierymenko@gmail.com> | 2016-09-20 21:21:34 -0700 |
|---|---|---|
| committer | Adam Ierymenko <adam.ierymenko@gmail.com> | 2016-09-20 21:21:34 -0700 |
| commit | d3524f36090c47e11c2647f022b03e27d16aeb13 (patch) | |
| tree | 47c29a8b95ca69b2b51b7230ebaf9816bfbb71d1 /node/Peer.cpp | |
| parent | 68e549233ddba17ec686a0462e2630580ee3d2a7 (diff) | |
| download | infinitytier-d3524f36090c47e11c2647f022b03e27d16aeb13.tar.gz infinitytier-d3524f36090c47e11c2647f022b03e27d16aeb13.zip | |
Refactor COM stuff a bit, and respond to COM requests a bit more readily for rapid setup. Will need to revisit later.
Diffstat (limited to 'node/Peer.cpp')
| -rw-r--r-- | node/Peer.cpp | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/node/Peer.cpp b/node/Peer.cpp index 78af9063..d742964a 100644 --- a/node/Peer.cpp +++ b/node/Peer.cpp @@ -41,7 +41,6 @@ namespace ZeroTier { static uint32_t _natKeepaliveBuf = 0; Peer::Peer(const RuntimeEnvironment *renv,const Identity &myIdentity,const Identity &peerIdentity) : - _lastUsed(0), _lastReceive(0), _lastUnicastFrame(0), _lastMulticastFrame(0), @@ -408,19 +407,16 @@ bool Peer::hasActiveDirectPath(uint64_t now) const return false; } -bool Peer::resetWithinScope(InetAddress::IpScope scope,int inetAddressFamily,uint64_t now) +void Peer::resetWithinScope(InetAddress::IpScope scope,int inetAddressFamily,uint64_t now) { Mutex::Lock _l(_paths_m); - bool resetSomething = false; for(unsigned int p=0;p<_numPaths;++p) { if ( (_paths[p].path->address().ss_family == inetAddressFamily) && (_paths[p].path->address().ipScope() == scope) ) { attemptToContactAt(_paths[p].path->localAddress(),_paths[p].path->address(),now); _paths[p].path->sent(now); - _paths[p].lastReceive >>= 2; // de-prioritize heavily vs. other paths, will get reset if we get OK(HELLO) or other traffic - resetSomething = true; + _paths[p].lastReceive = 0; // path will not be used unless it speaks again } } - return resetSomething; } void Peer::getBestActiveAddresses(uint64_t now,InetAddress &v4,InetAddress &v6) const |
