mirror of
https://github.com/ZeroTier/ZeroTierOne
synced 2025-08-19 21:03:57 -07:00
Use getPeerNoCache() in Cluster to avoid keeping all peers cached everywhere.
This commit is contained in:
parent
cc1b275ad9
commit
4221552c0b
2 changed files with 20 additions and 2 deletions
|
@ -78,6 +78,23 @@ public:
|
|||
*/
|
||||
SharedPtr<Peer> getPeer(const Address &zta);
|
||||
|
||||
/**
|
||||
* Get a peer only if it is presently in memory (no disk cache)
|
||||
*
|
||||
* @param zta ZeroTier address
|
||||
* @param now Current time
|
||||
*/
|
||||
inline SharedPtr<Peer> getPeerNoCache(const Address &zta,const uint64_t now)
|
||||
{
|
||||
Mutex::Lock _l(_lock);
|
||||
const SharedPtr<Peer> *ap = _peers.get(zta);
|
||||
if (ap) {
|
||||
(*ap)->use(now);
|
||||
return *ap;
|
||||
}
|
||||
return SharedPtr<Peer>();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the identity of a peer
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue