summaryrefslogtreecommitdiff
path: root/node/Peer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'node/Peer.cpp')
-rw-r--r--node/Peer.cpp11
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);