Browse Source

remove [] from yggdrasil reseed address

pull/1626/head
orignal 4 years ago
parent
commit
85902b358a
  1. 8
      libi2pd/Reseed.cpp

8
libi2pd/Reseed.cpp

@ -91,7 +91,8 @@ namespace data @@ -91,7 +91,8 @@ namespace data
{
LogPrint (eLogInfo, "Reseed: yggdrasil is supported");
std::string yggReseedURLs; i2p::config::GetOption("reseed.yggurls", yggReseedURLs);
boost::split(yggReseedHostList, yggReseedURLs, boost::is_any_of(","), boost::token_compress_on);
if (!yggReseedURLs.empty ())
boost::split(yggReseedHostList, yggReseedURLs, boost::is_any_of(","), boost::token_compress_on);
}
if (httpsReseedHostList.empty () && yggReseedHostList.empty())
@ -745,7 +746,10 @@ namespace data @@ -745,7 +746,10 @@ namespace data
boost::asio::io_service service;
boost::asio::ip::tcp::socket s(service, boost::asio::ip::tcp::v6());
s.connect (boost::asio::ip::tcp::endpoint (boost::asio::ip::address_v6::from_string (url.host), url.port), ecode);
if (url.host.length () < 2) return ""; // assume []
auto host = url.host.substr (1, url.host.length () - 2);
LogPrint (eLogDebug, "Reseed: Connecting to yggdrasil ", url.host, ":", url.port);
s.connect (boost::asio::ip::tcp::endpoint (boost::asio::ip::address_v6::from_string (host), url.port), ecode);
if (!ecode)
{
LogPrint (eLogDebug, "Reseed: Connected to yggdrasil ", url.host, ":", url.port);

Loading…
Cancel
Save