1
0
mirror of https://github.com/PurpleI2P/i2pd.git synced 2025-01-08 22:57:52 +00:00

check if port if specified

This commit is contained in:
orignal 2021-04-22 19:32:47 -04:00
parent b43a9cc80d
commit 9d79b26506

View File

@ -453,7 +453,7 @@ namespace transport
m_Service.post (std::bind (&SSUServer::CreateSessionThroughIntroducer, this, router, address, peerTest)); // always V4 thread m_Service.post (std::bind (&SSUServer::CreateSessionThroughIntroducer, this, router, address, peerTest)); // always V4 thread
else else
{ {
if (address->host.is_unspecified ()) return false; if (address->host.is_unspecified () || !address->port) return false;
boost::asio::ip::udp::endpoint remoteEndpoint (address->host, address->port); boost::asio::ip::udp::endpoint remoteEndpoint (address->host, address->port);
m_Service.post (std::bind (&SSUServer::CreateDirectSession, this, router, remoteEndpoint, peerTest)); m_Service.post (std::bind (&SSUServer::CreateDirectSession, this, router, remoteEndpoint, peerTest));
} }
@ -802,7 +802,7 @@ namespace transport
if (introducer && !requested.count (introducer)) // not requested already if (introducer && !requested.count (introducer)) // not requested already
{ {
auto address = v4 ? introducer->GetSSUAddress (true) : introducer->GetSSUV6Address (); auto address = v4 ? introducer->GetSSUAddress (true) : introducer->GetSSUV6Address ();
if (address && !address->host.is_unspecified ()) if (address && !address->host.is_unspecified () && address->port)
{ {
boost::asio::ip::udp::endpoint ep (address->host, address->port); boost::asio::ip::udp::endpoint ep (address->host, address->port);
if (std::find (introducers.begin (), introducers.end (), ep) == introducers.end ()) // not connected yet if (std::find (introducers.begin (), introducers.end (), ep) == introducers.end ()) // not connected yet