mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2024-11-19 21:25:30 +00:00
don't send session request twice
This commit is contained in:
parent
9a5a04ca70
commit
88e6a76a1b
16
SSU.cpp
16
SSU.cpp
@ -492,15 +492,17 @@ namespace ssu
|
|||||||
|
|
||||||
void SSUSession::Connect ()
|
void SSUSession::Connect ()
|
||||||
{
|
{
|
||||||
if (m_Server)
|
if (m_State == eSessionStateUnknown)
|
||||||
{
|
{
|
||||||
if (!m_ConnectTimer)
|
if (m_Server)
|
||||||
|
{
|
||||||
m_ConnectTimer = new boost::asio::deadline_timer (m_Server->GetService ());
|
m_ConnectTimer = new boost::asio::deadline_timer (m_Server->GetService ());
|
||||||
m_ConnectTimer->expires_from_now (boost::posix_time::seconds(SSU_CONNECT_TIMEOUT));
|
m_ConnectTimer->expires_from_now (boost::posix_time::seconds(SSU_CONNECT_TIMEOUT));
|
||||||
m_ConnectTimer->async_wait (boost::bind (&SSUSession::HandleConnectTimer,
|
m_ConnectTimer->async_wait (boost::bind (&SSUSession::HandleConnectTimer,
|
||||||
this, boost::asio::placeholders::error));
|
this, boost::asio::placeholders::error));
|
||||||
}
|
}
|
||||||
SendSessionRequest ();
|
SendSessionRequest ();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void SSUSession::HandleConnectTimer (const boost::system::error_code& ecode)
|
void SSUSession::HandleConnectTimer (const boost::system::error_code& ecode)
|
||||||
|
Loading…
Reference in New Issue
Block a user