Remove dead code (serverOptions)

This commit is contained in:
Stephen Shelton 2020-03-19 22:36:52 -06:00
parent 2e47262350
commit ffc58fcedb
No known key found for this signature in database
GPG Key ID: EE4BADACCE8B631C
3 changed files with 2 additions and 18 deletions

View File

@ -147,7 +147,6 @@ namespace llarp
std::string interface;
int addressFamily;
uint16_t port;
std::unordered_set<std::string> serverOptions;
};
public:

View File

@ -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,

View File

@ -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,