mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-06-05 03:53:44 +02:00
Tweak WHOIS path for federation.
This commit is contained in:
parent
6194d2af3d
commit
e3b1fc2ac0
3 changed files with 9 additions and 4 deletions
|
@ -202,7 +202,7 @@
|
||||||
/**
|
/**
|
||||||
* Maximum identity WHOIS retries (each attempt tries consulting a different peer)
|
* Maximum identity WHOIS retries (each attempt tries consulting a different peer)
|
||||||
*/
|
*/
|
||||||
#define ZT_MAX_WHOIS_RETRIES 3
|
#define ZT_MAX_WHOIS_RETRIES 4
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Transmit queue entry timeout
|
* Transmit queue entry timeout
|
||||||
|
@ -390,6 +390,11 @@
|
||||||
*/
|
*/
|
||||||
#define ZT_PEER_CREDEITIALS_CUTOFF_LIMIT 15
|
#define ZT_PEER_CREDEITIALS_CUTOFF_LIMIT 15
|
||||||
|
|
||||||
|
/**
|
||||||
|
* WHOIS rate limit (we allow these to be pretty fast)
|
||||||
|
*/
|
||||||
|
#define ZT_PEER_WHOIS_RATE_LIMIT 50
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* General rate limit for other kinds of rate-limited packets (HELLO, credential request, etc.) both inbound and outbound
|
* General rate limit for other kinds of rate-limited packets (HELLO, credential request, etc.) both inbound and outbound
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -370,7 +370,7 @@ public:
|
||||||
*/
|
*/
|
||||||
inline bool rateGateInboundWhoisRequest(const uint64_t now)
|
inline bool rateGateInboundWhoisRequest(const uint64_t now)
|
||||||
{
|
{
|
||||||
if ((now - _lastWhoisRequestReceived) >= ZT_PEER_GENERAL_RATE_LIMIT) {
|
if ((now - _lastWhoisRequestReceived) >= ZT_PEER_WHOIS_RATE_LIMIT) {
|
||||||
_lastWhoisRequestReceived = now;
|
_lastWhoisRequestReceived = now;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -688,9 +688,9 @@ unsigned long Switch::doTimerTasks(uint64_t now)
|
||||||
_outstandingWhoisRequests.erase(*a);
|
_outstandingWhoisRequests.erase(*a);
|
||||||
} else {
|
} else {
|
||||||
r->lastSent = now;
|
r->lastSent = now;
|
||||||
r->peersConsulted[r->retries] = _sendWhoisRequest(*a,r->peersConsulted,r->retries);
|
r->peersConsulted[r->retries] = _sendWhoisRequest(*a,r->peersConsulted,(r->retries > 1) ? r->retries : 0);
|
||||||
++r->retries;
|
|
||||||
TRACE("WHOIS %s (retry %u)",a->toString().c_str(),r->retries);
|
TRACE("WHOIS %s (retry %u)",a->toString().c_str(),r->retries);
|
||||||
|
++r->retries;
|
||||||
nextDelay = std::min(nextDelay,(unsigned long)ZT_WHOIS_RETRY_DELAY);
|
nextDelay = std::min(nextDelay,(unsigned long)ZT_WHOIS_RETRY_DELAY);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Add table
Reference in a new issue