mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2024-11-16 00:12:43 +00:00
30 seconds timeout for exploratory requests
This commit is contained in:
parent
8439f6dc57
commit
ba22a940f1
@ -181,12 +181,17 @@ namespace data
|
||||
{
|
||||
auto& dest = it->second;
|
||||
bool done = false;
|
||||
if (ts < dest->GetCreationTime () + MAX_REQUEST_TIME) // request becomes worthless
|
||||
{
|
||||
if (ts > dest->GetLastRequestTime () + MIN_REQUEST_TIME) // try next floodfill if no response after min interval
|
||||
done = !SendNextRequest (dest);
|
||||
}
|
||||
else // delete obsolete request
|
||||
if (!dest->IsExploratory ())
|
||||
{
|
||||
if (ts < dest->GetCreationTime () + MAX_REQUEST_TIME) // request becomes worthless
|
||||
{
|
||||
if (ts > dest->GetLastRequestTime () + MIN_REQUEST_TIME) // try next floodfill if no response after min interval
|
||||
done = !SendNextRequest (dest);
|
||||
}
|
||||
else // delete obsolete request
|
||||
done = true;
|
||||
}
|
||||
else if (ts >= dest->GetCreationTime () + MAX_EXPLORATORY_REQUEST_TIME)
|
||||
done = true;
|
||||
|
||||
if (done)
|
||||
|
@ -24,6 +24,7 @@ namespace data
|
||||
const uint64_t MANAGE_REQUESTS_INTERVAL = 1; // in seconds
|
||||
const uint64_t MIN_REQUEST_TIME = 5; // in seconds
|
||||
const uint64_t MAX_REQUEST_TIME = MAX_NUM_REQUEST_ATTEMPTS * (MIN_REQUEST_TIME + MANAGE_REQUESTS_INTERVAL);
|
||||
const uint64_t MAX_EXPLORATORY_REQUEST_TIME = 30; // in seconds
|
||||
|
||||
class RequestedDestination
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user