mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-28 11:47:48 +02:00
remove session after HolePunch received
This commit is contained in:
parent
83bd3b6f0b
commit
6ca9a599ff
3 changed files with 7 additions and 15 deletions
|
@ -51,14 +51,17 @@ namespace transport
|
|||
|
||||
void SSU2Session::Connect ()
|
||||
{
|
||||
if (m_State == eSSU2SessionStateUnknown)
|
||||
if (m_State == eSSU2SessionStateUnknown || m_State == eSSU2SessionStateTokenReceived)
|
||||
{
|
||||
ScheduleConnectTimer ();
|
||||
auto token = m_Server.FindOutgoingToken (m_RemoteEndpoint);
|
||||
if (token)
|
||||
SendSessionRequest (token);
|
||||
else
|
||||
{
|
||||
m_State = eSSU2SessionStateUnknown;
|
||||
SendTokenRequest ();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -959,9 +962,10 @@ namespace transport
|
|||
uint64_t oldConnID = GetConnID ();
|
||||
RAND_bytes ((uint8_t *)&m_DestConnID, 8);
|
||||
RAND_bytes ((uint8_t *)&m_SourceConnID, 8);
|
||||
m_Server.UpdateSessionConnID (oldConnID);
|
||||
// connect
|
||||
m_State = eSSU2SessionStateUnknown;
|
||||
m_State = eSSU2SessionStateTokenReceived;
|
||||
m_Server.AddPendingOutgoingSession (shared_from_this ());
|
||||
m_Server.RemoveSession (oldConnID);
|
||||
Connect ();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue