mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-24 01:46:36 +02:00
find SSU V6 sessions
This commit is contained in:
parent
54ec71d30d
commit
6320572917
1 changed files with 7 additions and 1 deletions
8
SSU.cpp
8
SSU.cpp
|
@ -1145,7 +1145,13 @@ namespace transport
|
||||||
SSUSession * SSUServer::FindSession (const i2p::data::RouterInfo * router)
|
SSUSession * SSUServer::FindSession (const i2p::data::RouterInfo * router)
|
||||||
{
|
{
|
||||||
if (!router) return nullptr;
|
if (!router) return nullptr;
|
||||||
auto address = router->GetSSUAddress ();
|
auto address = router->GetSSUAddress (true); // v4 only
|
||||||
|
if (!address) return nullptr;
|
||||||
|
auto session = FindSession (boost::asio::ip::udp::endpoint (address->host, address->port));
|
||||||
|
if (session || !context.SupportsV6 ())
|
||||||
|
return session;
|
||||||
|
// try v6
|
||||||
|
address = router->GetSSUV6Address ();
|
||||||
if (!address) return nullptr;
|
if (!address) return nullptr;
|
||||||
return FindSession (boost::asio::ip::udp::endpoint (address->host, address->port));
|
return FindSession (boost::asio::ip::udp::endpoint (address->host, address->port));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue