mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-28 03:37:49 +02:00
implement medium congestion indication
This commit is contained in:
parent
2b6a95cbee
commit
d677d67676
6 changed files with 92 additions and 54 deletions
|
@ -376,7 +376,7 @@ namespace i2p
|
|||
if (!i2p::context.DecryptTunnelBuildRecord (record + BUILD_REQUEST_RECORD_ENCRYPTED_OFFSET, clearText)) return false;
|
||||
uint8_t retCode = 0;
|
||||
// replace record to reply
|
||||
if (i2p::context.AcceptsTunnels () && !i2p::context.IsHighCongestion ())
|
||||
if (i2p::context.AcceptsTunnels () && i2p::context.GetCongestionLevel (false) < 100)
|
||||
{
|
||||
auto transitTunnel = i2p::tunnel::CreateTransitTunnel (
|
||||
bufbe32toh (clearText + ECIES_BUILD_REQUEST_RECORD_RECEIVE_TUNNEL_OFFSET),
|
||||
|
@ -586,7 +586,7 @@ namespace i2p
|
|||
// check if we accept this tunnel
|
||||
std::shared_ptr<i2p::tunnel::TransitTunnel> transitTunnel;
|
||||
uint8_t retCode = 0;
|
||||
if (!i2p::context.AcceptsTunnels () || i2p::context.IsHighCongestion ())
|
||||
if (!i2p::context.AcceptsTunnels () || i2p::context.GetCongestionLevel (false) >= 100)
|
||||
retCode = 30;
|
||||
if (!retCode)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue