Rate gate ECHO per Path instead of per Peer

This commit is contained in:
Joseph Henry 2022-02-21 14:37:39 -08:00
parent 1b0c183913
commit 5e13b42abc
No known key found for this signature in database
GPG key ID: C45B33FF5EBC9344
4 changed files with 18 additions and 15 deletions

View file

@ -418,18 +418,6 @@ public:
return false;
}
/**
* Rate limit gate for inbound ECHO requests
*/
inline bool rateGateEchoRequest(const int64_t now)
{
if ((now - _lastEchoRequestReceived) >= ZT_PEER_GENERAL_RATE_LIMIT) {
_lastEchoRequestReceived = now;
return true;
}
return false;
}
/**
* Serialize a peer for storage in local cache
*
@ -546,7 +534,6 @@ private:
int64_t _lastTriedMemorizedPath;
int64_t _lastDirectPathPushSent;
int64_t _lastDirectPathPushReceive;
int64_t _lastEchoRequestReceived;
int64_t _lastCredentialRequestSent;
int64_t _lastWhoisRequestReceived;
int64_t _lastCredentialsReceived;