mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-01-22 08:14:15 +00:00
eliminate bad_function_call exception
This commit is contained in:
parent
7a7ae4cc83
commit
739b6645f8
@ -527,7 +527,8 @@ namespace client
|
|||||||
if (floodfill)
|
if (floodfill)
|
||||||
{
|
{
|
||||||
auto request = std::make_shared<LeaseSetRequest> (m_Service);
|
auto request = std::make_shared<LeaseSetRequest> (m_Service);
|
||||||
request->requestComplete.push_back (requestComplete);
|
if (requestComplete)
|
||||||
|
request->requestComplete.push_back (requestComplete);
|
||||||
auto ts = i2p::util::GetSecondsSinceEpoch ();
|
auto ts = i2p::util::GetSecondsSinceEpoch ();
|
||||||
auto ret = m_LeaseSetRequests.insert (std::pair<i2p::data::IdentHash, std::shared_ptr<LeaseSetRequest> >(dest,request));
|
auto ret = m_LeaseSetRequests.insert (std::pair<i2p::data::IdentHash, std::shared_ptr<LeaseSetRequest> >(dest,request));
|
||||||
if (ret.second) // inserted
|
if (ret.second) // inserted
|
||||||
@ -537,7 +538,7 @@ namespace client
|
|||||||
{
|
{
|
||||||
// request failed
|
// request failed
|
||||||
m_LeaseSetRequests.erase (ret.first);
|
m_LeaseSetRequests.erase (ret.first);
|
||||||
requestComplete (nullptr);
|
if (requestComplete) requestComplete (nullptr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else // duplicate
|
else // duplicate
|
||||||
@ -547,13 +548,13 @@ namespace client
|
|||||||
//ret.first->second->requestComplete.push_back (requestComplete);
|
//ret.first->second->requestComplete.push_back (requestComplete);
|
||||||
if (ts > ret.first->second->requestTime + MAX_LEASESET_REQUEST_TIMEOUT)
|
if (ts > ret.first->second->requestTime + MAX_LEASESET_REQUEST_TIMEOUT)
|
||||||
m_LeaseSetRequests.erase (ret.first);
|
m_LeaseSetRequests.erase (ret.first);
|
||||||
requestComplete (nullptr);
|
if (requestComplete) requestComplete (nullptr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
LogPrint (eLogError, "Destination: Can't request LeaseSet, no floodfills found");
|
LogPrint (eLogError, "Destination: Can't request LeaseSet, no floodfills found");
|
||||||
requestComplete (nullptr);
|
if (requestComplete) requestComplete (nullptr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user