Browse Source

eliminate bad_function_call exception

pull/731/head
orignal 8 years ago
parent
commit
739b6645f8
  1. 7
      Destination.cpp

7
Destination.cpp

@ -527,6 +527,7 @@ namespace client @@ -527,6 +527,7 @@ namespace client
if (floodfill)
{
auto request = std::make_shared<LeaseSetRequest> (m_Service);
if (requestComplete)
request->requestComplete.push_back (requestComplete);
auto ts = i2p::util::GetSecondsSinceEpoch ();
auto ret = m_LeaseSetRequests.insert (std::pair<i2p::data::IdentHash, std::shared_ptr<LeaseSetRequest> >(dest,request));
@ -537,7 +538,7 @@ namespace client @@ -537,7 +538,7 @@ namespace client
{
// request failed
m_LeaseSetRequests.erase (ret.first);
requestComplete (nullptr);
if (requestComplete) requestComplete (nullptr);
}
}
else // duplicate
@ -547,13 +548,13 @@ namespace client @@ -547,13 +548,13 @@ namespace client
//ret.first->second->requestComplete.push_back (requestComplete);
if (ts > ret.first->second->requestTime + MAX_LEASESET_REQUEST_TIMEOUT)
m_LeaseSetRequests.erase (ret.first);
requestComplete (nullptr);
if (requestComplete) requestComplete (nullptr);
}
}
else
{
LogPrint (eLogError, "Destination: Can't request LeaseSet, no floodfills found");
requestComplete (nullptr);
if (requestComplete) requestComplete (nullptr);
}
}

Loading…
Cancel
Save