mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2026-10-22 10:32:27 +00:00
pass LeaseSet to callback of RequestDestination
This commit is contained in:
1 parent
bc21f5955f
commit
634976cdde
9 files changed
+39
-67
No files matched your search
+2
-5
@@ -460,18 +460,15 @@ namespace client
|
||||
auto leaseSet = i2p::client::context.GetSharedLocalDestination ()->FindLeaseSet (ident);
|
||||
if (!leaseSet)
|
||||
{
|
||||
bool found = false;
|
||||
std::unique_lock<std::mutex> l(newDataReceivedMutex);
|
||||
i2p::client::context.GetSharedLocalDestination ()->RequestDestination (ident,
|
||||
[&newDataReceived, &found](bool success)
|
||||
[&newDataReceived, &leaseSet](std::shared_ptr<i2p::data::LeaseSet> ls)
|
||||
{
|
||||
found = success;
|
||||
leaseSet = ls;
|
||||
newDataReceived.notify_all ();
|
||||
});
|
||||
if (newDataReceived.wait_for (l, std::chrono::seconds (SUBSCRIPTION_REQUEST_TIMEOUT)) == std::cv_status::timeout)
|
||||
LogPrint (eLogError, "Subscription LeseseSet request timeout expired");
|
||||
if (found)
|
||||
leaseSet = i2p::client::context.GetSharedLocalDestination ()->FindLeaseSet (ident);
|
||||
}
|
||||
if (leaseSet)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user