|
|
|
@ -206,10 +206,9 @@ namespace data
@@ -206,10 +206,9 @@ namespace data
|
|
|
|
|
s.read ((char *)&m_Timestamp, sizeof (m_Timestamp)); |
|
|
|
|
m_Timestamp = be64toh (m_Timestamp); |
|
|
|
|
// read addresses
|
|
|
|
|
auto addresses = boost::make_shared<Addresses>(); |
|
|
|
|
if (!m_NewAddresses) m_NewAddresses = boost::make_shared<Addresses>(); |
|
|
|
|
uint8_t numAddresses; |
|
|
|
|
s.read ((char *)&numAddresses, sizeof (numAddresses)); |
|
|
|
|
addresses->reserve (numAddresses); |
|
|
|
|
for (int i = 0; i < numAddresses; i++) |
|
|
|
|
{ |
|
|
|
|
uint8_t supportedTransports = 0; |
|
|
|
@ -418,15 +417,19 @@ namespace data
@@ -418,15 +417,19 @@ namespace data
|
|
|
|
|
if (supportedTransports) |
|
|
|
|
{ |
|
|
|
|
if (!(m_SupportedTransports & supportedTransports)) // avoid duplicates
|
|
|
|
|
addresses->push_back(address); |
|
|
|
|
m_NewAddresses->push_back(address); |
|
|
|
|
m_SupportedTransports |= supportedTransports; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
// update addresses
|
|
|
|
|
auto prev = m_Addresses; |
|
|
|
|
#if (BOOST_VERSION >= 105300) |
|
|
|
|
boost::atomic_store (&m_Addresses, addresses); |
|
|
|
|
boost::atomic_store (&m_Addresses, m_NewAddresses); |
|
|
|
|
#else |
|
|
|
|
m_Addresses = addresses; // race condition
|
|
|
|
|
m_Addresses = m_NewAddresses; // race condition
|
|
|
|
|
#endif |
|
|
|
|
if (prev) prev->clear (); |
|
|
|
|
m_NewAddresses = prev; |
|
|
|
|
// read peers
|
|
|
|
|
uint8_t numPeers; |
|
|
|
|
s.read ((char *)&numPeers, sizeof (numPeers)); if (!s) return; |
|
|
|
|