mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-28 11:47:48 +02:00
disable NTCP for good
This commit is contained in:
parent
8483464aab
commit
a8d23b5439
5 changed files with 33 additions and 116 deletions
|
@ -316,7 +316,7 @@ namespace data
|
|||
}
|
||||
if (introducers) supportedTransports |= eSSUV4; // in case if host is not presented
|
||||
if (isNTCP2Only && address->ntcp2) address->ntcp2->isNTCP2Only = true;
|
||||
if (supportedTransports)
|
||||
if (supportedTransports & ~(eNTCPV4 | eNTCPV6)) // exclude NTCP only
|
||||
{
|
||||
addresses->push_back(address);
|
||||
m_SupportedTransports |= supportedTransports;
|
||||
|
@ -477,7 +477,12 @@ namespace data
|
|||
s.write ((const char *)&address.date, sizeof (address.date));
|
||||
std::stringstream properties;
|
||||
if (address.transportStyle == eTransportNTCP)
|
||||
WriteString (address.IsNTCP2 () ? "NTCP2" : "NTCP", s);
|
||||
{
|
||||
if (address.IsNTCP2 ())
|
||||
WriteString ("NTCP2", s);
|
||||
else
|
||||
continue; // don't write NTCP address
|
||||
}
|
||||
else if (address.transportStyle == eTransportSSU)
|
||||
{
|
||||
WriteString ("SSU", s);
|
||||
|
@ -817,14 +822,6 @@ namespace data
|
|||
return "";
|
||||
}
|
||||
|
||||
bool RouterInfo::IsNTCP (bool v4only) const
|
||||
{
|
||||
if (v4only)
|
||||
return m_SupportedTransports & eNTCPV4;
|
||||
else
|
||||
return m_SupportedTransports & (eNTCPV4 | eNTCPV6);
|
||||
}
|
||||
|
||||
bool RouterInfo::IsSSU (bool v4only) const
|
||||
{
|
||||
if (v4only)
|
||||
|
@ -907,15 +904,6 @@ namespace data
|
|||
return m_Caps & Caps::eUnreachable; // non-reachable
|
||||
}
|
||||
|
||||
std::shared_ptr<const RouterInfo::Address> RouterInfo::GetNTCPAddress (bool v4only) const
|
||||
{
|
||||
return GetAddress (
|
||||
[v4only](std::shared_ptr<const RouterInfo::Address> address)->bool
|
||||
{
|
||||
return (address->transportStyle == eTransportNTCP) && !address->IsNTCP2Only () && (!v4only || address->host.is_v4 ());
|
||||
});
|
||||
}
|
||||
|
||||
std::shared_ptr<const RouterInfo::Address> RouterInfo::GetSSUAddress (bool v4only) const
|
||||
{
|
||||
return GetAddress (
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue