mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-30 04:37:50 +02:00
pass LeaseSet to callback of RequestDestination
This commit is contained in:
parent
bc21f5955f
commit
634976cdde
9 changed files with 39 additions and 67 deletions
19
Datagram.cpp
19
Datagram.cpp
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue