diff options
| author | Adam Ierymenko <adam.ierymenko@gmail.com> | 2016-11-22 14:23:13 -0800 |
|---|---|---|
| committer | Adam Ierymenko <adam.ierymenko@gmail.com> | 2016-11-22 14:23:13 -0800 |
| commit | 84732fcb12d66708e7887fba51413cbe629d86d3 (patch) | |
| tree | fc034a71d0c421ed2b5b1dbf0426700e8adeedfa /node/Peer.cpp | |
| parent | c6c578ce1db2bb6acfeb8de15c90169282eb2c49 (diff) | |
| download | infinitytier-84732fcb12d66708e7887fba51413cbe629d86d3.tar.gz infinitytier-84732fcb12d66708e7887fba51413cbe629d86d3.zip | |
Wire through external path lookup. Static paths should now work.
Diffstat (limited to 'node/Peer.cpp')
| -rw-r--r-- | node/Peer.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/node/Peer.cpp b/node/Peer.cpp index e0bd0eac..2ef139e1 100644 --- a/node/Peer.cpp +++ b/node/Peer.cpp @@ -43,6 +43,7 @@ static uint32_t _natKeepaliveBuf = 0; Peer::Peer(const RuntimeEnvironment *renv,const Identity &myIdentity,const Identity &peerIdentity) : _lastReceive(0), _lastNontrivialReceive(0), + _lastTriedMemorizedPath(0), _lastDirectPathPushSent(0), _lastDirectPathPushReceive(0), _lastCredentialRequestSent(0), @@ -373,6 +374,16 @@ void Peer::attemptToContactAt(const InetAddress &localAddr,const InetAddress &at } } +void Peer::tryMemorizedPath(uint64_t now) +{ + if ((now - _lastTriedMemorizedPath) >= ZT_TRY_MEMORIZED_PATH_INTERVAL) { + _lastTriedMemorizedPath = now; + InetAddress mp; + if (RR->node->externalPathLookup(_id.address(),-1,mp)) + attemptToContactAt(InetAddress(),mp,now); + } +} + bool Peer::doPingAndKeepalive(uint64_t now,int inetAddressFamily) { Mutex::Lock _l(_paths_m); |
