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

add relaytag after session established

This commit is contained in:
orignal 2016-12-31 13:52:26 -05:00
parent 6b6df15dd9
commit 585a6c29d4

View File

@ -462,7 +462,6 @@ namespace transport
{ {
RAND_bytes((uint8_t *)&m_SentRelayTag, 4); RAND_bytes((uint8_t *)&m_SentRelayTag, 4);
if (!m_SentRelayTag) m_SentRelayTag = 1; if (!m_SentRelayTag) m_SentRelayTag = 1;
m_Server.AddRelay (m_SentRelayTag, shared_from_this ());
} }
htobe32buf (payload, m_SentRelayTag); htobe32buf (payload, m_SentRelayTag);
payload += 4; // relay tag payload += 4; // relay tag
@ -887,6 +886,8 @@ namespace transport
transports.PeerConnected (shared_from_this ()); transports.PeerConnected (shared_from_this ());
if (m_IsPeerTest) if (m_IsPeerTest)
SendPeerTest (); SendPeerTest ();
if (m_SentRelayTag)
m_Server.AddRelay (m_SentRelayTag, shared_from_this ());
m_LastActivityTimestamp = i2p::util::GetSecondsSinceEpoch (); m_LastActivityTimestamp = i2p::util::GetSecondsSinceEpoch ();
} }