mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-03-07 06:09:42 +00:00
* drop i2p::util::config::GetCharArg
This commit is contained in:
@@ -74,8 +74,8 @@ namespace i2p
|
|||||||
int port = i2p::util::config::GetArg("-port", 0);
|
int port = i2p::util::config::GetArg("-port", 0);
|
||||||
if (port)
|
if (port)
|
||||||
i2p::context.UpdatePort (port);
|
i2p::context.UpdatePort (port);
|
||||||
const char * host = i2p::util::config::GetCharArg("-host", "");
|
std::string host = i2p::util::config::GetArg("-host", "");
|
||||||
if (host && host[0])
|
if (host != "")
|
||||||
i2p::context.UpdateAddress (boost::asio::ip::address::from_string (host));
|
i2p::context.UpdateAddress (boost::asio::ip::address::from_string (host));
|
||||||
|
|
||||||
i2p::context.SetSupportsV6 (i2p::util::config::GetArg("-v6", 0));
|
i2p::context.SetSupportsV6 (i2p::util::config::GetArg("-v6", 0));
|
||||||
|
|||||||
@@ -46,8 +46,8 @@ namespace i2p
|
|||||||
int port = i2p::util::config::GetArg("-port", 0);
|
int port = i2p::util::config::GetArg("-port", 0);
|
||||||
if (!port)
|
if (!port)
|
||||||
port = rand () % (30777 - 9111) + 9111; // I2P network ports range
|
port = rand () % (30777 - 9111) + 9111; // I2P network ports range
|
||||||
routerInfo.AddSSUAddress (i2p::util::config::GetCharArg("-host", "127.0.0.1"), port, routerInfo.GetIdentHash ());
|
routerInfo.AddSSUAddress (i2p::util::config::GetArg("-host", "127.0.0.1").c_str (), port, routerInfo.GetIdentHash ());
|
||||||
routerInfo.AddNTCPAddress (i2p::util::config::GetCharArg("-host", "127.0.0.1"), port);
|
routerInfo.AddNTCPAddress (i2p::util::config::GetArg("-host", "127.0.0.1").c_str (), port);
|
||||||
routerInfo.SetCaps (i2p::data::RouterInfo::eReachable |
|
routerInfo.SetCaps (i2p::data::RouterInfo::eReachable |
|
||||||
i2p::data::RouterInfo::eSSUTesting | i2p::data::RouterInfo::eSSUIntroducer); // LR, BC
|
i2p::data::RouterInfo::eSSUTesting | i2p::data::RouterInfo::eSSUIntroducer); // LR, BC
|
||||||
routerInfo.SetProperty ("coreVersion", I2P_VERSION);
|
routerInfo.SetProperty ("coreVersion", I2P_VERSION);
|
||||||
|
|||||||
7
util.cpp
7
util.cpp
@@ -114,13 +114,6 @@ namespace config
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const char* GetCharArg(const std::string& strArg, const std::string& nDefault)
|
|
||||||
{
|
|
||||||
if (mapArgs.count(strArg))
|
|
||||||
return mapArgs[strArg].c_str();
|
|
||||||
return nDefault.c_str();
|
|
||||||
}
|
|
||||||
|
|
||||||
std::string GetArg(const std::string& strArg, const std::string& strDefault)
|
std::string GetArg(const std::string& strArg, const std::string& strDefault)
|
||||||
{
|
{
|
||||||
if (mapArgs.count(strArg))
|
if (mapArgs.count(strArg))
|
||||||
|
|||||||
Reference in New Issue
Block a user