mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-28 11:47:48 +02:00
implement SSU2HolPunchSession
This commit is contained in:
parent
ec1f41b13c
commit
97fdedfbe3
5 changed files with 88 additions and 49 deletions
|
@ -479,9 +479,11 @@ namespace transport
|
|||
{
|
||||
if (session)
|
||||
{
|
||||
m_Sessions.emplace (session->GetConnID (), session);
|
||||
if (session->GetState () != eSSU2SessionStatePeerTest)
|
||||
AddSessionByRouterHash (session);
|
||||
if (m_Sessions.emplace (session->GetConnID (), session).second)
|
||||
{
|
||||
if (session->GetState () != eSSU2SessionStatePeerTest)
|
||||
AddSessionByRouterHash (session);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -715,6 +717,9 @@ namespace transport
|
|||
m_LastSession->SetRemoteEndpoint (senderEndpoint);
|
||||
m_LastSession->ProcessPeerTest (buf, len);
|
||||
break;
|
||||
case eSSU2SessionStateHolePunch:
|
||||
m_LastSession->ProcessFirstIncomingMessage (connID, buf, len); // SessionRequest
|
||||
break;
|
||||
case eSSU2SessionStateClosing:
|
||||
m_LastSession->ProcessData (buf, len, senderEndpoint); // we might receive termintaion block
|
||||
if (m_LastSession && m_LastSession->GetState () == eSSU2SessionStateClosing)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue