mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-01-22 13:27:17 +01:00
terminate session in separate task
This commit is contained in:
parent
6b513a0f95
commit
4b1f5c9c9b
|
@ -403,7 +403,7 @@ namespace transport
|
|||
case eSSU2SessionStateSessionCreatedSent:
|
||||
if (!m_LastSession->ProcessSessionConfirmed (buf, len))
|
||||
{
|
||||
m_LastSession->Terminate ();
|
||||
m_LastSession->Done ();
|
||||
m_LastSession = nullptr;
|
||||
}
|
||||
break;
|
||||
|
@ -416,7 +416,7 @@ namespace transport
|
|||
{
|
||||
LogPrint (eLogWarning, "SSU2: HolePunch endpoint ", senderEndpoint,
|
||||
" doesn't match RelayResponse ", m_LastSession->GetRemoteEndpoint ());
|
||||
m_LastSession->Terminate ();
|
||||
m_LastSession->Done ();
|
||||
m_LastSession = nullptr;
|
||||
}
|
||||
break;
|
||||
|
@ -678,13 +678,13 @@ namespace transport
|
|||
{
|
||||
auto state = it.second->GetState ();
|
||||
if (state == eSSU2SessionStateTerminated || state == eSSU2SessionStateClosing)
|
||||
GetService ().post (std::bind (&SSU2Session::Terminate, it.second));
|
||||
it.second->Done ();
|
||||
else if (it.second->IsTerminationTimeoutExpired (ts))
|
||||
{
|
||||
if (it.second->IsEstablished ())
|
||||
it.second->RequestTermination (eSSU2TerminationReasonIdleTimeout);
|
||||
else
|
||||
GetService ().post (std::bind (&SSU2Session::Terminate, it.second));
|
||||
it.second->Done ();
|
||||
}
|
||||
else
|
||||
it.second->CleanUp (ts);
|
||||
|
|
|
@ -1338,7 +1338,7 @@ namespace transport
|
|||
if (IsEstablished () && buf[11] != eSSU2TerminationReasonTerminationReceived)
|
||||
RequestTermination (eSSU2TerminationReasonTerminationReceived);
|
||||
else
|
||||
Terminate ();
|
||||
Done ();
|
||||
break;
|
||||
case eSSU2BlkRelayRequest:
|
||||
LogPrint (eLogDebug, "SSU2: RelayRequest");
|
||||
|
@ -1696,13 +1696,13 @@ namespace transport
|
|||
else
|
||||
{
|
||||
LogPrint (eLogWarning, "SSU2: RelayResponse signature verification failed");
|
||||
m_Server.GetService ().post (std::bind (&SSU2Session::Terminate, it->second.first));
|
||||
it->second.first->Done ();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
LogPrint (eLogInfo, "SSU2: RelayResponse status code=", (int)buf[1]);
|
||||
m_Server.GetService ().post (std::bind (&SSU2Session::Terminate, it->second.first));
|
||||
it->second.first->Done ();
|
||||
}
|
||||
}
|
||||
m_RelaySessions.erase (it);
|
||||
|
@ -1898,13 +1898,13 @@ namespace transport
|
|||
else
|
||||
{
|
||||
LogPrint (eLogWarning, "SSU2: Peer test 4 address not found");
|
||||
it->second.first->Terminate ();
|
||||
it->second.first->Done ();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
LogPrint (eLogWarning, "SSU2: Peer test 4 signature verification failed");
|
||||
it->second.first->Terminate ();
|
||||
it->second.first->Done ();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1914,7 +1914,7 @@ namespace transport
|
|||
i2p::data::GetIdentHashAbbreviation (buf[1] < 64 ? GetRemoteIdentity ()->GetIdentHash () : i2p::data::IdentHash (buf + 3)));
|
||||
if (GetRouterStatus () == eRouterStatusTesting)
|
||||
SetRouterStatus (eRouterStatusUnknown);
|
||||
it->second.first->Terminate ();
|
||||
it->second.first->Done ();
|
||||
}
|
||||
m_PeerTests.erase (it);
|
||||
}
|
||||
|
|
|
@ -222,7 +222,6 @@ namespace transport
|
|||
void WaitForIntroduction ();
|
||||
void SendPeerTest (); // Alice, Data message
|
||||
void SendKeepAlive ();
|
||||
void Terminate ();
|
||||
void RequestTermination (SSU2TerminationReason reason);
|
||||
void CleanUp (uint64_t ts);
|
||||
void FlushData ();
|
||||
|
@ -246,6 +245,7 @@ namespace transport
|
|||
|
||||
private:
|
||||
|
||||
void Terminate ();
|
||||
void Established ();
|
||||
void ScheduleConnectTimer ();
|
||||
void HandleConnectTimer (const boost::system::error_code& ecode);
|
||||
|
|
Loading…
Reference in a new issue