pass LeaseSet to callback of RequestDestination

This commit is contained in:
orignal 2015-04-07 12:02:25 -04:00
parent bc21f5955f
commit 634976cdde
9 changed files with 39 additions and 67 deletions

View file

@ -41,22 +41,15 @@ namespace datagram
if (remote)
m_Owner.GetService ().post (std::bind (&DatagramDestination::SendMsg, this, msg, remote));
else
m_Owner.RequestDestination (ident, std::bind (&DatagramDestination::HandleLeaseSetRequestComplete,
this, std::placeholders::_1, msg, ident));
m_Owner.RequestDestination (ident, std::bind (&DatagramDestination::HandleLeaseSetRequestComplete, this, std::placeholders::_1, msg));
}
void DatagramDestination::HandleLeaseSetRequestComplete (bool success, I2NPMessage * msg, i2p::data::IdentHash ident)
void DatagramDestination::HandleLeaseSetRequestComplete (std::shared_ptr<i2p::data::LeaseSet> remote, I2NPMessage * msg)
{
if (success)
{
auto remote = m_Owner.FindLeaseSet (ident);
if (remote)
{
SendMsg (msg, remote);
return;
}
}
DeleteI2NPMessage (msg);
if (remote)
SendMsg (msg, remote);
else
DeleteI2NPMessage (msg);
}
void DatagramDestination::SendMsg (I2NPMessage * msg, std::shared_ptr<const i2p::data::LeaseSet> remote)