diff --git a/SSU.cpp b/SSU.cpp index fe625fb6..990feb87 100644 --- a/SSU.cpp +++ b/SSU.cpp @@ -135,6 +135,7 @@ namespace transport if (!session) { session = new SSUSession (*this, from); + session->WaitForConnect (); m_Sessions[from] = session; LogPrint ("New SSU session from ", from.address ().to_string (), ":", from.port (), " created"); } diff --git a/SSUSession.cpp b/SSUSession.cpp index 7a1e9b06..ca39a3a7 100644 --- a/SSUSession.cpp +++ b/SSUSession.cpp @@ -21,8 +21,6 @@ namespace transport m_Data (*this), m_NumSentBytes (0), m_NumReceivedBytes (0) { m_CreationTime = i2p::util::GetSecondsSinceEpoch (); - if (!router) // incoming session - ScheduleConnectTimer (); } SSUSession::~SSUSession () @@ -701,6 +699,14 @@ namespace transport } } + void SSUSession::WaitForConnect () + { + if (!m_RemoteRouter) // incoming session + ScheduleConnectTimer (); + else + LogPrint (eLogError, "SSU wait for connect for outgoing session"); + } + void SSUSession::ScheduleConnectTimer () { m_Timer.cancel (); diff --git a/SSUSession.h b/SSUSession.h index 4ae7a74a..631d0aa7 100644 --- a/SSUSession.h +++ b/SSUSession.h @@ -60,6 +60,7 @@ namespace transport ~SSUSession (); void Connect (); + void WaitForConnect (); void Introduce (uint32_t iTag, const uint8_t * iKey); void WaitForIntroduction (); void Close ();