mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-28 11:47:48 +02:00
bypass medium congestion(D) routers for client tunnels
This commit is contained in:
parent
572694b141
commit
4ebc7c970a
5 changed files with 25 additions and 12 deletions
|
@ -1113,13 +1113,25 @@ namespace data
|
|||
m_Timestamp = i2p::util::GetMillisecondsSinceEpoch ();
|
||||
}
|
||||
|
||||
bool RouterInfo::IsHighCongestion () const
|
||||
bool RouterInfo::IsHighCongestion (bool highBandwidth) const
|
||||
{
|
||||
if (m_Congestion == eLowCongestion || m_Congestion == eMediumCongestion) return false;
|
||||
if (m_Congestion == eRejectAll) return true;
|
||||
if (m_Congestion == eHighCongestion)
|
||||
return (i2p::util::GetMillisecondsSinceEpoch () < m_Timestamp + HIGH_CONGESTION_INTERVAL*1000LL) ? true : false;
|
||||
return false;
|
||||
switch (m_Congestion)
|
||||
{
|
||||
case eLowCongestion:
|
||||
return false;
|
||||
break;
|
||||
case eMediumCongestion:
|
||||
return highBandwidth;
|
||||
break;
|
||||
case eHighCongestion:
|
||||
return i2p::util::GetMillisecondsSinceEpoch () < m_Timestamp + HIGH_CONGESTION_INTERVAL*1000LL;
|
||||
break;
|
||||
case eRejectAll:
|
||||
return true;
|
||||
break;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
void LocalRouterInfo::CreateBuffer (const PrivateKeys& privateKeys)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue