Browse Source

check for pending LeaseSet request

pull/147/head
orignal 10 years ago
parent
commit
c61ed150b7
  1. 12
      Destination.cpp

12
Destination.cpp

@ -464,7 +464,9 @@ namespace client @@ -464,7 +464,9 @@ namespace client
{
LeaseSetRequest * request = new LeaseSetRequest (m_Service);
request->requestComplete = requestComplete;
m_LeaseSetRequests[dest] = request;
auto ret = m_LeaseSetRequests.insert (std::pair<i2p::data::IdentHash, LeaseSetRequest *>(dest,request));
if (ret.second) // inserted
{
if (!SendLeaseSetRequest (dest, floodfill, request))
{
// request failed
@ -473,6 +475,14 @@ namespace client @@ -473,6 +475,14 @@ namespace client
m_LeaseSetRequests.erase (dest);
}
}
else // duplicate
{
LogPrint (eLogError, "Request of ", dest.ToBase64 (), " is pending already");
// TODO: queue up requests
if (request->requestComplete) request->requestComplete (false);
delete request;
}
}
else
LogPrint (eLogError, "No floodfills found");
}

Loading…
Cancel
Save