mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-28 11:47:48 +02:00
pick peer test session only if Charlie's address supports peer testing
This commit is contained in:
parent
38cc01e13d
commit
f8722f17c6
4 changed files with 14 additions and 7 deletions
|
@ -494,7 +494,7 @@ namespace transport
|
|||
m_PendingOutgoingSessions.erase (ep);
|
||||
}
|
||||
|
||||
std::shared_ptr<SSU2Session> SSU2Server::GetRandomSession (
|
||||
std::shared_ptr<SSU2Session> SSU2Server::GetRandomPeerTestSession (
|
||||
i2p::data::RouterInfo::CompatibleTransports remoteTransports, const i2p::data::IdentHash& excluded) const
|
||||
{
|
||||
if (m_Sessions.empty ()) return nullptr;
|
||||
|
@ -505,7 +505,7 @@ namespace transport
|
|||
std::advance (it, ind);
|
||||
while (it != m_Sessions.end ())
|
||||
{
|
||||
if ((it->second->GetRemoteTransports () & remoteTransports) &&
|
||||
if ((it->second->GetRemotePeerTestTransports () & remoteTransports) &&
|
||||
it->second->GetRemoteIdentity ()->GetIdentHash () != excluded)
|
||||
return it->second;
|
||||
it++;
|
||||
|
@ -514,7 +514,7 @@ namespace transport
|
|||
it = m_Sessions.begin ();
|
||||
while (it != m_Sessions.end () && ind)
|
||||
{
|
||||
if ((it->second->GetRemoteTransports () & remoteTransports) &&
|
||||
if ((it->second->GetRemotePeerTestTransports () & remoteTransports) &&
|
||||
it->second->GetRemoteIdentity ()->GetIdentHash () != excluded)
|
||||
return it->second;
|
||||
it++; ind--;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue