mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-28 11:47:48 +02:00
cache complete request for a while and not send the same request again
This commit is contained in:
parent
8a20d3219b
commit
396aa6944d
3 changed files with 52 additions and 30 deletions
|
@ -780,7 +780,7 @@ namespace data
|
|||
auto dest = m_Requests.CreateRequest (destination, false, direct, requestComplete); // non-exploratory
|
||||
if (!dest)
|
||||
{
|
||||
LogPrint (eLogWarning, "NetDb: Destination ", destination.ToBase64(), " is requested already");
|
||||
LogPrint (eLogWarning, "NetDb: Destination ", destination.ToBase64(), " is requested already or cached");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1000,7 +1000,7 @@ namespace data
|
|||
LogPrint (eLogDebug, "NetDb: DatabaseSearchReply for ", key, " num=", num);
|
||||
IdentHash ident (buf);
|
||||
auto dest = m_Requests.FindRequest (ident);
|
||||
if (dest)
|
||||
if (dest && dest->IsActive ())
|
||||
{
|
||||
if (!dest->IsExploratory () && (num > 0 || dest->GetNumExcludedPeers () < 3)) // before 3-rd attempt might be just bad luck
|
||||
// try to send next requests
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue