mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-03-13 04:46:38 +01:00
set router properties from incoming connections
This commit is contained in:
parent
6206616347
commit
c22fc75370
1 changed files with 6 additions and 3 deletions
|
@ -729,7 +729,7 @@ namespace transport
|
||||||
session->SendI2NPMessages (it->second.delayedMessages);
|
session->SendI2NPMessages (it->second.delayedMessages);
|
||||||
it->second.delayedMessages.clear ();
|
it->second.delayedMessages.clear ();
|
||||||
}
|
}
|
||||||
else // incoming connection
|
else // incoming connection or peer test
|
||||||
{
|
{
|
||||||
if(RoutesRestricted() && ! IsRestrictedPeer(ident)) {
|
if(RoutesRestricted() && ! IsRestrictedPeer(ident)) {
|
||||||
// not trusted
|
// not trusted
|
||||||
|
@ -737,11 +737,14 @@ namespace transport
|
||||||
session->Done();
|
session->Done();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
session->SendI2NPMessages ({ CreateDatabaseStoreMsg () }); // send DatabaseStore
|
if (!session->IsOutgoing ()) // incoming
|
||||||
|
session->SendI2NPMessages ({ CreateDatabaseStoreMsg () }); // send DatabaseStore
|
||||||
|
auto r = i2p::data::netdb.FindRouter (ident); // router should be in netdb after SessionConfirmed
|
||||||
auto ts = i2p::util::GetSecondsSinceEpoch ();
|
auto ts = i2p::util::GetSecondsSinceEpoch ();
|
||||||
std::unique_lock<std::mutex> l(m_PeersMutex);
|
std::unique_lock<std::mutex> l(m_PeersMutex);
|
||||||
auto it = m_Peers.insert (std::make_pair (ident, Peer{ nullptr, ts })).first;
|
auto it = m_Peers.insert (std::make_pair (ident, Peer{ r, ts })).first;
|
||||||
it->second.sessions.push_back (session);
|
it->second.sessions.push_back (session);
|
||||||
|
it->second.router = nullptr;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue