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

set supported transports flag after actual address insertion

This commit is contained in:
orignal 2016-02-10 16:09:34 -05:00
parent d51bf735c4
commit 61ad6a2b88

View File

@ -146,6 +146,7 @@ namespace data
bool introducers = false;
for (int i = 0; i < numAddresses; i++)
{
uint8_t supportedTransports = 0;
bool isValidAddress = true;
Address address;
s.read ((char *)&address.cost, sizeof (address.cost));
@ -178,12 +179,12 @@ namespace data
{
if (address.transportStyle == eTransportNTCP)
{
m_SupportedTransports |= eNTCPV4; // TODO:
supportedTransports |= eNTCPV4; // TODO:
address.addressString = value;
}
else
{
m_SupportedTransports |= eSSUV4; // TODO:
supportedTransports |= eSSUV4; // TODO:
address.addressString = value;
}
}
@ -191,9 +192,9 @@ namespace data
{
// add supported protocol
if (address.host.is_v4 ())
m_SupportedTransports |= (address.transportStyle == eTransportNTCP) ? eNTCPV4 : eSSUV4;
supportedTransports |= (address.transportStyle == eTransportNTCP) ? eNTCPV4 : eSSUV4;
else
m_SupportedTransports |= (address.transportStyle == eTransportNTCP) ? eNTCPV6 : eSSUV6;
supportedTransports |= (address.transportStyle == eTransportNTCP) ? eNTCPV6 : eSSUV6;
}
}
else if (!strcmp (key, "port"))
@ -229,7 +230,10 @@ namespace data
if (!s) return;
}
if (isValidAddress)
{
m_Addresses.push_back(address);
m_SupportedTransports |= supportedTransports;
}
}
// read peers
uint8_t numPeers;