wait from LeaseSet request comlete

This commit is contained in:
orignal 2014-12-27 10:09:55 -05:00
parent 59aa40e2b0
commit da01ea997d
2 changed files with 5 additions and 6 deletions

View File

@ -213,9 +213,8 @@ namespace client
CreateConnection (socket); CreateConnection (socket);
else else
{ {
GetLocalDestination ()->RequestDestination (*m_DestinationIdentHash); GetLocalDestination ()->RequestDestination (*m_DestinationIdentHash,
m_Timer.expires_from_now (boost::posix_time::seconds (I2P_TUNNEL_DESTINATION_REQUEST_TIMEOUT)); std::bind (&I2PClientTunnel::HandleLeaseSetRequestComplete,
m_Timer.async_wait (std::bind (&I2PClientTunnel::HandleDestinationRequestTimer,
this, std::placeholders::_1, socket)); this, std::placeholders::_1, socket));
} }
} }
@ -231,9 +230,9 @@ namespace client
delete socket; delete socket;
} }
void I2PClientTunnel::HandleDestinationRequestTimer (const boost::system::error_code& ecode, boost::asio::ip::tcp::socket * socket) void I2PClientTunnel::HandleLeaseSetRequestComplete (bool success, boost::asio::ip::tcp::socket * socket)
{ {
if (ecode != boost::asio::error::operation_aborted) if (success)
{ {
if (m_DestinationIdentHash) if (m_DestinationIdentHash)
{ {

View File

@ -92,7 +92,7 @@ namespace client
void Accept (); void Accept ();
void HandleAccept (const boost::system::error_code& ecode, boost::asio::ip::tcp::socket * socket); void HandleAccept (const boost::system::error_code& ecode, boost::asio::ip::tcp::socket * socket);
void HandleDestinationRequestTimer (const boost::system::error_code& ecode, boost::asio::ip::tcp::socket * socket); void HandleLeaseSetRequestComplete (bool success, boost::asio::ip::tcp::socket * socket);
void CreateConnection (boost::asio::ip::tcp::socket * socket); void CreateConnection (boost::asio::ip::tcp::socket * socket);
private: private: