From b91a32fcc27991bc75d55d04ea8c34b8246c2948 Mon Sep 17 00:00:00 2001 From: EKCKABATOP54 Date: Tue, 14 May 2024 16:13:59 +0200 Subject: [PATCH] Set default bandwidth to 256 KB/sec --- contrib/docker/i2pd-docker.conf | 2 +- contrib/i2pd.conf | 4 ++-- daemon/Daemon.cpp | 10 +++++----- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/contrib/docker/i2pd-docker.conf b/contrib/docker/i2pd-docker.conf index 3b91a235..67c38eea 100644 --- a/contrib/docker/i2pd-docker.conf +++ b/contrib/docker/i2pd-docker.conf @@ -10,7 +10,7 @@ loglevel = none ipv4 = true ipv6 = false -# bandwidth = L +# bandwidth = O # notransit = false # floodfill = false diff --git a/contrib/i2pd.conf b/contrib/i2pd.conf index be4a6719..b8c645d8 100644 --- a/contrib/i2pd.conf +++ b/contrib/i2pd.conf @@ -79,7 +79,7 @@ ipv6 = false ## Bandwidth configuration ## L limit bandwidth to 32 KB/sec, O - to 256 KB/sec, P - to 2048 KB/sec, ## 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 ## 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 @@ -87,7 +87,7 @@ ipv6 = false ## 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 ## router algorithms. -# bandwidth = L +# bandwidth = O ## Max % of bandwidth limit for transit. 0-100 (default: 100) # share = 100 diff --git a/daemon/Daemon.cpp b/daemon/Daemon.cpp index 090792bf..ecbbc4be 100644 --- a/daemon/Daemon.cpp +++ b/daemon/Daemon.cpp @@ -188,7 +188,7 @@ namespace util std::string bandwidth; i2p::config::GetOption("bandwidth", bandwidth); 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]); LogPrint(eLogInfo, "Daemon: Bandwidth set to ", i2p::context.GetBandwidthLimit (), "KBps"); @@ -203,8 +203,8 @@ namespace util } else { - LogPrint(eLogInfo, "Daemon: Unexpected bandwidth ", bandwidth, ". Set to 'low'"); - i2p::context.SetBandwidth (i2p::data::CAPS_FLAG_LOW_BANDWIDTH2); + LogPrint(eLogInfo, "Daemon: Unexpected bandwidth ", bandwidth, ". Set to 'O'"); + i2p::context.SetBandwidth (i2p::data::CAPS_FLAG_HIGH_BANDWIDTH2); } } } @@ -215,8 +215,8 @@ namespace util } else { - LogPrint(eLogInfo, "Daemon: bandwidth set to 'low'"); - i2p::context.SetBandwidth (i2p::data::CAPS_FLAG_LOW_BANDWIDTH2); + LogPrint(eLogInfo, "Daemon: bandwidth set to 'O'"); + i2p::context.SetBandwidth (i2p::data::CAPS_FLAG_HIGH_BANDWIDTH2); } int shareRatio; i2p::config::GetOption("share", shareRatio);