mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-01-22 08:14:15 +00:00
remove SSU address if SSU is off
This commit is contained in:
parent
df92a85159
commit
3dd78a2589
@ -253,6 +253,7 @@ namespace util
|
|||||||
if (!ipv4 && !ipv6)
|
if (!ipv4 && !ipv6)
|
||||||
i2p::context.SetStatus (eRouterStatusMesh);
|
i2p::context.SetStatus (eRouterStatusMesh);
|
||||||
}
|
}
|
||||||
|
if (!ssu) i2p::context.RemoveSSUAddress (); // TODO: remove later
|
||||||
bool ssu2; i2p::config::GetOption("ssu2.enabled", ssu2);
|
bool ssu2; i2p::config::GetOption("ssu2.enabled", ssu2);
|
||||||
if (ssu2)
|
if (ssu2)
|
||||||
{
|
{
|
||||||
|
@ -628,6 +628,18 @@ namespace i2p
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void RouterContext::RemoveSSUAddress ()
|
||||||
|
{
|
||||||
|
auto& addresses = m_RouterInfo.GetAddresses ();
|
||||||
|
for (auto it = addresses.begin (); it != addresses.end ();)
|
||||||
|
{
|
||||||
|
if ((*it)->transportStyle == i2p::data::RouterInfo::eTransportSSU)
|
||||||
|
it = addresses.erase (it);
|
||||||
|
else
|
||||||
|
++it;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void RouterContext::SetUnreachableSSU2 (bool v4, bool v6)
|
void RouterContext::SetUnreachableSSU2 (bool v4, bool v6)
|
||||||
{
|
{
|
||||||
if (IsSSU2Only ())
|
if (IsSSU2Only ())
|
||||||
|
@ -123,6 +123,7 @@ namespace garlic
|
|||||||
void PublishSSU2Address (int port, bool publish, bool v4, bool v6);
|
void PublishSSU2Address (int port, bool publish, bool v4, bool v6);
|
||||||
void UpdateSSU2Address (bool enable);
|
void UpdateSSU2Address (bool enable);
|
||||||
void RemoveNTCPAddress (bool v4only = true); // delete NTCP address for older routers. TODO: remove later
|
void RemoveNTCPAddress (bool v4only = true); // delete NTCP address for older routers. TODO: remove later
|
||||||
|
void RemoveSSUAddress (); // delete SSU address for older routers
|
||||||
bool AddIntroducer (const i2p::data::RouterInfo::Introducer& introducer);
|
bool AddIntroducer (const i2p::data::RouterInfo::Introducer& introducer);
|
||||||
void RemoveIntroducer (const boost::asio::ip::udp::endpoint& e);
|
void RemoveIntroducer (const boost::asio::ip::udp::endpoint& e);
|
||||||
bool AddSSU2Introducer (const i2p::data::RouterInfo::Introducer& introducer, bool v4);
|
bool AddSSU2Introducer (const i2p::data::RouterInfo::Introducer& introducer, bool v4);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user