mirror of
https://github.com/PurpleI2P/i2pd
synced 2024-11-10 08:00:38 +03:00
sequential LeaseSet request
This commit is contained in:
parent
3643d6b5d5
commit
d97acacae6
@ -373,26 +373,24 @@ namespace client
|
|||||||
for (int i = 0; i < num; i++)
|
for (int i = 0; i < num; i++)
|
||||||
{
|
{
|
||||||
i2p::data::IdentHash peerHash (buf + 33 + i*32);
|
i2p::data::IdentHash peerHash (buf + 33 + i*32);
|
||||||
auto floodfill = i2p::data::netdb.FindRouter (peerHash);
|
if (!request->excluded.count (peerHash) && !i2p::data::netdb.FindRouter (peerHash))
|
||||||
if (floodfill)
|
|
||||||
{
|
{
|
||||||
LogPrint (eLogInfo, "Destination: Requesting ", key.ToBase64 (), " at ", peerHash.ToBase64 ());
|
|
||||||
if (SendLeaseSetRequest (key, floodfill, request))
|
|
||||||
found = true;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
LogPrint (eLogInfo, "Destination: Found new floodfill, request it"); // TODO: recheck this message
|
LogPrint (eLogInfo, "Destination: Found new floodfill, request it"); // TODO: recheck this message
|
||||||
i2p::data::netdb.RequestDestination (peerHash);
|
i2p::data::netdb.RequestDestination (peerHash);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!found)
|
|
||||||
LogPrint (eLogError, "Destination: Suggested floodfills are not presented in netDb");
|
auto floodfill = i2p::data::netdb.GetClosestFloodfill (key, request->excluded);
|
||||||
|
if (floodfill)
|
||||||
|
{
|
||||||
|
LogPrint (eLogInfo, "Destination: Requesting ", key.ToBase64 (), " at ", floodfill->GetIdentHash ().ToBase64 ());
|
||||||
|
if (SendLeaseSetRequest (key, floodfill, request))
|
||||||
|
found = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
LogPrint (eLogInfo, "Destination: ", key.ToBase64 (), " was not found on ", MAX_NUM_FLOODFILLS_PER_REQUEST, " floodfills");
|
|
||||||
if (!found)
|
if (!found)
|
||||||
{
|
{
|
||||||
|
LogPrint (eLogInfo, "Destination: ", key.ToBase64 (), " was not found on ", MAX_NUM_FLOODFILLS_PER_REQUEST, " floodfills");
|
||||||
if (request->requestComplete) request->requestComplete (nullptr);
|
if (request->requestComplete) request->requestComplete (nullptr);
|
||||||
m_LeaseSetRequests.erase (key);
|
m_LeaseSetRequests.erase (key);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user