mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-11-07 10:00:13 +00:00
Remove GetCharArg(). Organize CLI options file.
GetCharArg() was either a hack to keep from segfaulting when using this botched option parser or it was old forgotten code - or both. GetCharArg() was not needed because from_string() has std::string overloaded and every GetCharArg() made its way to from_string(). Note: when using from_string() with std::string, it must be caught!
This commit is contained in:
parent
1eff72d525
commit
5ae7e35e80
9 changed files with 60 additions and 46 deletions
|
|
@ -71,7 +71,7 @@ namespace client
|
|||
ircPort, localDestination
|
||||
);
|
||||
ircTunnel->Start ();
|
||||
// TODO: allow muliple tunnels on the same port (but on a different address)
|
||||
// TODO: allow multiple tunnels on the same port (but on a different address)
|
||||
m_ClientTunnels.insert(std::make_pair(
|
||||
ircPort, std::unique_ptr<I2PClientTunnel>(ircTunnel)
|
||||
));
|
||||
|
|
|
|||
|
|
@ -76,9 +76,11 @@ namespace i2p
|
|||
int port = i2p::util::config::GetArg("-port", 0);
|
||||
if (port)
|
||||
i2p::context.UpdatePort (port);
|
||||
const char * host = i2p::util::config::GetCharArg("-host", "");
|
||||
if (host && host[0])
|
||||
i2p::context.UpdateAddress (boost::asio::ip::address::from_string (host));
|
||||
const std::string host = i2p::util::config::GetArg("-host", "");
|
||||
// The host option is deprecated, so this was always true.
|
||||
// Because of -Waddress, it's now exposed as the hack it was.
|
||||
if (&host && host[0])
|
||||
i2p::context.UpdateAddress (boost::asio::ip::address::from_string (host));
|
||||
|
||||
i2p::context.SetSupportsV6 (i2p::util::config::GetArg("-v6", 0));
|
||||
i2p::context.SetFloodfill (i2p::util::config::GetArg("-floodfill", 0));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue