mirror of https://github.com/oxen-io/lokinet
Remove dead code (serverOptions)
This commit is contained in:
parent
2e47262350
commit
ffc58fcedb
|
@ -147,7 +147,6 @@ namespace llarp
|
|||
std::string interface;
|
||||
int addressFamily;
|
||||
uint16_t port;
|
||||
std::unordered_set<std::string> serverOptions;
|
||||
};
|
||||
|
||||
public:
|
||||
|
|
|
@ -534,23 +534,9 @@ namespace llarp
|
|||
for(const LinksConfig::LinkInfo &serverConfig : conf->links.inboundLinks())
|
||||
{
|
||||
// get default factory
|
||||
// TODO: this is dead code, as is everything related to _defaultLinkType,
|
||||
// also review LinkFactory for dead code
|
||||
auto inboundLinkFactory = LinkFactory::Obtain(_defaultLinkType, true);
|
||||
// for each option if provided ...
|
||||
for(const auto &opt : serverConfig.serverOptions)
|
||||
{
|
||||
// try interpreting it as a link type
|
||||
const auto linktype = LinkFactory::TypeFromName(opt);
|
||||
if (linktype != LinkFactory::LinkType::eLinkUnknown)
|
||||
{
|
||||
// override link factory if it's a valid link type
|
||||
auto factory = LinkFactory::Obtain(linktype, true);
|
||||
if (factory)
|
||||
{
|
||||
inboundLinkFactory = std::move(factory);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
auto server = inboundLinkFactory(
|
||||
m_keyManager,
|
||||
|
|
|
@ -101,7 +101,6 @@ ifaddr=10.101.0.1/16
|
|||
ASSERT_EQ(links[0].interface, "eth0");
|
||||
ASSERT_EQ(links[0].addressFamily, AF_INET);
|
||||
ASSERT_EQ(links[0].port, 5501);
|
||||
ASSERT_TRUE(links[0].serverOptions.empty());
|
||||
}
|
||||
|
||||
ASSERT_THAT(config.bootstrap.routers,
|
||||
|
|
Loading…
Reference in New Issue