mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-01-22 21:37:17 +01:00
* Daemon_Singleton::init : rewrite setting bandwidth limit and floodfill mode
This commit is contained in:
parent
26d232c567
commit
0f7e2ad11a
13
Daemon.cpp
13
Daemon.cpp
|
@ -93,19 +93,20 @@ namespace i2p
|
|||
i2p::context.SetAcceptsTunnels (!transit);
|
||||
|
||||
bool isFloodfill; i2p::config::GetOption("floodfill", isFloodfill);
|
||||
i2p::context.SetFloodfill (isFloodfill);
|
||||
char bandwidth; i2p::config::GetOption("bandwidth", bandwidth);
|
||||
|
||||
char bandwidth; i2p::config::GetOption("bandwidth", bandwidth);
|
||||
if (bandwidth != '-')
|
||||
{
|
||||
if (isFloodfill) {
|
||||
LogPrint(eLogInfo, "Daemon: router will be floodfill, bandwidth set to 'extra'");
|
||||
i2p::context.SetFloodfill (true);
|
||||
i2p::context.SetExtraBandwidth ();
|
||||
} else if (bandwidth != '-') {
|
||||
LogPrint(eLogInfo, "Daemon: bandwidth set to ", bandwidth);
|
||||
switch (bandwidth) {
|
||||
case 'P' : i2p::context.SetExtraBandwidth (); break;
|
||||
case 'L' : i2p::context.SetHighBandwidth (); break;
|
||||
default : i2p::context.SetLowBandwidth (); break;
|
||||
}
|
||||
}
|
||||
else if (isFloodfill)
|
||||
i2p::context.SetExtraBandwidth ();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue