mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-01-11 17:37:53 +00:00
move WaitForConnect away from constructor
This commit is contained in:
parent
97656e7349
commit
1a0957b571
1
SSU.cpp
1
SSU.cpp
@ -135,6 +135,7 @@ namespace transport
|
|||||||
if (!session)
|
if (!session)
|
||||||
{
|
{
|
||||||
session = new SSUSession (*this, from);
|
session = new SSUSession (*this, from);
|
||||||
|
session->WaitForConnect ();
|
||||||
m_Sessions[from] = session;
|
m_Sessions[from] = session;
|
||||||
LogPrint ("New SSU session from ", from.address ().to_string (), ":", from.port (), " created");
|
LogPrint ("New SSU session from ", from.address ().to_string (), ":", from.port (), " created");
|
||||||
}
|
}
|
||||||
|
@ -21,8 +21,6 @@ namespace transport
|
|||||||
m_Data (*this), m_NumSentBytes (0), m_NumReceivedBytes (0)
|
m_Data (*this), m_NumSentBytes (0), m_NumReceivedBytes (0)
|
||||||
{
|
{
|
||||||
m_CreationTime = i2p::util::GetSecondsSinceEpoch ();
|
m_CreationTime = i2p::util::GetSecondsSinceEpoch ();
|
||||||
if (!router) // incoming session
|
|
||||||
ScheduleConnectTimer ();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SSUSession::~SSUSession ()
|
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 ()
|
void SSUSession::ScheduleConnectTimer ()
|
||||||
{
|
{
|
||||||
m_Timer.cancel ();
|
m_Timer.cancel ();
|
||||||
|
@ -60,6 +60,7 @@ namespace transport
|
|||||||
~SSUSession ();
|
~SSUSession ();
|
||||||
|
|
||||||
void Connect ();
|
void Connect ();
|
||||||
|
void WaitForConnect ();
|
||||||
void Introduce (uint32_t iTag, const uint8_t * iKey);
|
void Introduce (uint32_t iTag, const uint8_t * iKey);
|
||||||
void WaitForIntroduction ();
|
void WaitForIntroduction ();
|
||||||
void Close ();
|
void Close ();
|
||||||
|
Loading…
Reference in New Issue
Block a user