fixed crash

This commit is contained in:
orignal 2015-03-23 13:08:04 -04:00
parent 57578a3aa3
commit 217ddfe98d
2 changed files with 13 additions and 9 deletions

View File

@ -596,17 +596,20 @@ namespace stream
LogPrint (eLogInfo, "All leases are expired. Trying to request"); LogPrint (eLogInfo, "All leases are expired. Trying to request");
m_RemoteLeaseSet = nullptr; m_RemoteLeaseSet = nullptr;
m_LocalDestination.GetOwner ().RequestDestination (m_RemoteIdentity.GetIdentHash (), m_LocalDestination.GetOwner ().RequestDestination (m_RemoteIdentity.GetIdentHash (),
[packets, this](bool success) std::bind (&Stream::HandleLeaseSetRequestComplete, shared_from_this (),
{ std::placeholders::_1, packets));
if (success)
{
LogPrint (eLogInfo, "New LeaseSet found. Sending packets");
SendPackets (packets);
}
});
} }
} }
void Stream::HandleLeaseSetRequestComplete (bool success, std::vector<Packet *> packets)
{
if (success)
{
LogPrint (eLogInfo, "New LeaseSet found. Sending packets");
SendPackets (packets);
}
}
void Stream::ScheduleResend () void Stream::ScheduleResend ()
{ {
m_ResendTimer.cancel (); m_ResendTimer.cancel ();

View File

@ -147,7 +147,8 @@ namespace stream
template<typename Buffer, typename ReceiveHandler> template<typename Buffer, typename ReceiveHandler>
void HandleReceiveTimer (const boost::system::error_code& ecode, const Buffer& buffer, ReceiveHandler handler); void HandleReceiveTimer (const boost::system::error_code& ecode, const Buffer& buffer, ReceiveHandler handler);
void HandleLeaseSetRequestComplete (bool success, std::vector<Packet *> packets);
void ScheduleResend (); void ScheduleResend ();
void HandleResendTimer (const boost::system::error_code& ecode); void HandleResendTimer (const boost::system::error_code& ecode);
void HandleAckSendTimer (const boost::system::error_code& ecode); void HandleAckSendTimer (const boost::system::error_code& ecode);