mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-28 11:47:48 +02:00
use existing SSU session if available
This commit is contained in:
parent
129052c330
commit
3ae225fb41
3 changed files with 36 additions and 25 deletions
12
SSU.cpp
12
SSU.cpp
|
@ -796,6 +796,18 @@ namespace ssu
|
|||
LogPrint ("SSU receive error: ", ecode.message ());
|
||||
}
|
||||
|
||||
SSUSession * SSUServer::FindSession (const i2p::data::RouterInfo * router)
|
||||
{
|
||||
if (!router) return nullptr;
|
||||
auto address = router->GetSSUAddress ();
|
||||
if (!address) return nullptr;
|
||||
auto it = m_Sessions.find (boost::asio::ip::udp::endpoint (address->host, address->port));
|
||||
if (it != m_Sessions.end ())
|
||||
return it->second;
|
||||
else
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
SSUSession * SSUServer::GetSession (const i2p::data::RouterInfo * router)
|
||||
{
|
||||
SSUSession * session = nullptr;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue