mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-27 11:17:49 +02:00
fix #846. ability to limit transit bandwidth
This commit is contained in:
parent
ac918e3618
commit
124e2e759c
7 changed files with 26 additions and 4 deletions
|
@ -17,8 +17,8 @@ namespace i2p
|
|||
|
||||
RouterContext::RouterContext ():
|
||||
m_LastUpdateTime (0), m_AcceptsTunnels (true), m_IsFloodfill (false),
|
||||
m_StartupTime (0), m_Status (eRouterStatusOK), m_Error (eRouterErrorNone),
|
||||
m_NetID (I2PD_NET_ID)
|
||||
m_StartupTime (0), m_ShareRatio (100), m_Status (eRouterStatusOK),
|
||||
m_Error (eRouterErrorNone), m_NetID (I2PD_NET_ID)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -246,6 +246,13 @@ namespace i2p
|
|||
else { SetBandwidth('K'); }
|
||||
}
|
||||
|
||||
void RouterContext::SetShareRatio (int percents)
|
||||
{
|
||||
if (percents < 0) percents = 0;
|
||||
if (percents > 100) percents = 100;
|
||||
m_ShareRatio = percents;
|
||||
}
|
||||
|
||||
bool RouterContext::IsUnreachable () const
|
||||
{
|
||||
return m_RouterInfo.GetCaps () & i2p::data::RouterInfo::eUnreachable;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue