Set default bandwidth to 256 KB/sec

This commit is contained in:
EKCKABATOP54 2024-05-14 16:13:59 +02:00
parent f5b823a712
commit b91a32fcc2
3 changed files with 8 additions and 8 deletions

View file

@ -10,7 +10,7 @@ loglevel = none
ipv4 = true ipv4 = true
ipv6 = false ipv6 = false
# bandwidth = L # bandwidth = O
# notransit = false # notransit = false
# floodfill = false # floodfill = false

View file

@ -79,7 +79,7 @@ ipv6 = false
## Bandwidth configuration ## Bandwidth configuration
## L limit bandwidth to 32 KB/sec, O - to 256 KB/sec, P - to 2048 KB/sec, ## L limit bandwidth to 32 KB/sec, O - to 256 KB/sec, P - to 2048 KB/sec,
## X - unlimited ## X - unlimited
## Default is L (regular node) and X if floodfill mode enabled. ## Default is O (regular node) and X if floodfill mode enabled.
## If you want to share more bandwidth without floodfill mode, uncomment ## If you want to share more bandwidth without floodfill mode, uncomment
## that line and adjust value to your possibilities. Value can be set to ## that line and adjust value to your possibilities. Value can be set to
## integer in kilobytes, it will apply that limit and flag will be used ## integer in kilobytes, it will apply that limit and flag will be used
@ -87,7 +87,7 @@ ipv6 = false
## limit will be 4096 KB/s). Same can be done when floodfill mode is used, ## limit will be 4096 KB/s). Same can be done when floodfill mode is used,
## but keep in mind that low values may be negatively evaluated by Java ## but keep in mind that low values may be negatively evaluated by Java
## router algorithms. ## router algorithms.
# bandwidth = L # bandwidth = O
## Max % of bandwidth limit for transit. 0-100 (default: 100) ## Max % of bandwidth limit for transit. 0-100 (default: 100)
# share = 100 # share = 100

View file

@ -188,7 +188,7 @@ namespace util
std::string bandwidth; i2p::config::GetOption("bandwidth", bandwidth); std::string bandwidth; i2p::config::GetOption("bandwidth", bandwidth);
if (bandwidth.length () > 0) if (bandwidth.length () > 0)
{ {
if (bandwidth[0] >= 'K' && bandwidth[0] <= 'X') if (bandwidth.length() == 1 && ((bandwidth[0] >= 'K' && bandwidth[0] <= 'P') || bandwidth[0] == 'X' ))
{ {
i2p::context.SetBandwidth (bandwidth[0]); i2p::context.SetBandwidth (bandwidth[0]);
LogPrint(eLogInfo, "Daemon: Bandwidth set to ", i2p::context.GetBandwidthLimit (), "KBps"); LogPrint(eLogInfo, "Daemon: Bandwidth set to ", i2p::context.GetBandwidthLimit (), "KBps");
@ -203,8 +203,8 @@ namespace util
} }
else else
{ {
LogPrint(eLogInfo, "Daemon: Unexpected bandwidth ", bandwidth, ". Set to 'low'"); LogPrint(eLogInfo, "Daemon: Unexpected bandwidth ", bandwidth, ". Set to 'O'");
i2p::context.SetBandwidth (i2p::data::CAPS_FLAG_LOW_BANDWIDTH2); i2p::context.SetBandwidth (i2p::data::CAPS_FLAG_HIGH_BANDWIDTH2);
} }
} }
} }
@ -215,8 +215,8 @@ namespace util
} }
else else
{ {
LogPrint(eLogInfo, "Daemon: bandwidth set to 'low'"); LogPrint(eLogInfo, "Daemon: bandwidth set to 'O'");
i2p::context.SetBandwidth (i2p::data::CAPS_FLAG_LOW_BANDWIDTH2); i2p::context.SetBandwidth (i2p::data::CAPS_FLAG_HIGH_BANDWIDTH2);
} }
int shareRatio; i2p::config::GetOption("share", shareRatio); int shareRatio; i2p::config::GetOption("share", shareRatio);