mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-01-22 13:27:17 +01:00
ability post LeaseSet update to destination's thread
This commit is contained in:
parent
fe71776b6f
commit
bc9d25ec3b
|
@ -588,9 +588,12 @@ namespace client
|
||||||
i2p::garlic::GarlicDestination::HandleDeliveryStatusMessage (msgID);
|
i2p::garlic::GarlicDestination::HandleDeliveryStatusMessage (msgID);
|
||||||
}
|
}
|
||||||
|
|
||||||
void LeaseSetDestination::SetLeaseSetUpdated ()
|
void LeaseSetDestination::SetLeaseSetUpdated (bool post)
|
||||||
{
|
{
|
||||||
UpdateLeaseSet ();
|
if (post)
|
||||||
|
m_Service.post([s = shared_from_this ()]() { s->UpdateLeaseSet (); });
|
||||||
|
else
|
||||||
|
UpdateLeaseSet ();
|
||||||
}
|
}
|
||||||
|
|
||||||
void LeaseSetDestination::Publish ()
|
void LeaseSetDestination::Publish ()
|
||||||
|
|
|
@ -150,7 +150,7 @@ namespace client
|
||||||
void SubmitECIESx25519Key (const uint8_t * key, uint64_t tag);
|
void SubmitECIESx25519Key (const uint8_t * key, uint64_t tag);
|
||||||
void ProcessGarlicMessage (std::shared_ptr<I2NPMessage> msg);
|
void ProcessGarlicMessage (std::shared_ptr<I2NPMessage> msg);
|
||||||
void ProcessDeliveryStatusMessage (std::shared_ptr<I2NPMessage> msg);
|
void ProcessDeliveryStatusMessage (std::shared_ptr<I2NPMessage> msg);
|
||||||
void SetLeaseSetUpdated ();
|
void SetLeaseSetUpdated (bool post) override;
|
||||||
|
|
||||||
bool IsPublic () const { return m_IsPublic; };
|
bool IsPublic () const { return m_IsPublic; };
|
||||||
void SetPublic (bool pub) { m_IsPublic = pub; };
|
void SetPublic (bool pub) { m_IsPublic = pub; };
|
||||||
|
|
|
@ -897,7 +897,7 @@ namespace garlic
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void GarlicDestination::SetLeaseSetUpdated ()
|
void GarlicDestination::SetLeaseSetUpdated (bool post)
|
||||||
{
|
{
|
||||||
{
|
{
|
||||||
std::unique_lock<std::mutex> l(m_SessionsMutex);
|
std::unique_lock<std::mutex> l(m_SessionsMutex);
|
||||||
|
|
|
@ -253,7 +253,7 @@ namespace garlic
|
||||||
|
|
||||||
virtual void ProcessGarlicMessage (std::shared_ptr<I2NPMessage> msg);
|
virtual void ProcessGarlicMessage (std::shared_ptr<I2NPMessage> msg);
|
||||||
virtual void ProcessDeliveryStatusMessage (std::shared_ptr<I2NPMessage> msg);
|
virtual void ProcessDeliveryStatusMessage (std::shared_ptr<I2NPMessage> msg);
|
||||||
virtual void SetLeaseSetUpdated ();
|
virtual void SetLeaseSetUpdated (bool post = false);
|
||||||
|
|
||||||
virtual std::shared_ptr<const i2p::data::LocalLeaseSet> GetLeaseSet () = 0; // TODO
|
virtual std::shared_ptr<const i2p::data::LocalLeaseSet> GetLeaseSet () = 0; // TODO
|
||||||
virtual std::shared_ptr<i2p::tunnel::TunnelPool> GetTunnelPool () const = 0;
|
virtual std::shared_ptr<i2p::tunnel::TunnelPool> GetTunnelPool () const = 0;
|
||||||
|
|
|
@ -259,7 +259,7 @@ namespace tunnel
|
||||||
{
|
{
|
||||||
// update LeaseSet
|
// update LeaseSet
|
||||||
auto dest = pool->GetLocalDestination ();
|
auto dest = pool->GetLocalDestination ();
|
||||||
if (dest) dest->SetLeaseSetUpdated ();
|
if (dest) dest->SetLeaseSetUpdated (true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
EncryptTunnelMsg (msg, msg);
|
EncryptTunnelMsg (msg, msg);
|
||||||
|
|
Loading…
Reference in a new issue