1
1
/*
2
- * Copyright (c) 2013-2024 , The PurpleI2P Project
2
+ * Copyright (c) 2013-2025 , The PurpleI2P Project
3
3
*
4
4
* This file is part of Purple i2pd project and licensed under BSD3
5
5
*
@@ -20,8 +20,10 @@ namespace i2p
20
20
namespace data
21
21
{
22
22
RequestedDestination::RequestedDestination (const IdentHash& destination, bool isExploratory, bool direct):
23
- m_Destination (destination), m_IsExploratory (isExploratory), m_IsDirect (direct), m_IsActive (true ),
24
- m_CreationTime (i2p::util::GetMillisecondsSinceEpoch ()), m_LastRequestTime (0 ), m_NumAttempts (0 )
23
+ m_Destination (destination), m_IsExploratory (isExploratory), m_IsDirect (direct),
24
+ m_IsActive (true ), m_IsSentDirectly (false ),
25
+ m_CreationTime (i2p::util::GetMillisecondsSinceEpoch ()),
26
+ m_LastRequestTime (0 ), m_NumAttempts (0 )
25
27
{
26
28
if (i2p::context.IsFloodfill ())
27
29
m_ExcludedPeers.insert (i2p::context.GetIdentHash ()); // exclude self if floodfill
@@ -46,6 +48,7 @@ namespace data
46
48
m_ExcludedPeers.insert (router->GetIdentHash ());
47
49
m_LastRequestTime = i2p::util::GetMillisecondsSinceEpoch ();
48
50
m_NumAttempts++;
51
+ m_IsSentDirectly = false ;
49
52
return msg;
50
53
}
51
54
@@ -56,6 +59,7 @@ namespace data
56
59
m_ExcludedPeers.insert (floodfill);
57
60
m_NumAttempts++;
58
61
m_LastRequestTime = i2p::util::GetMillisecondsSinceEpoch ();
62
+ m_IsSentDirectly = true ;
59
63
return msg;
60
64
}
61
65
@@ -222,7 +226,8 @@ namespace data
222
226
bool done = false ;
223
227
if (ts < dest->GetCreationTime () + MAX_REQUEST_TIME)
224
228
{
225
- if (ts > dest->GetLastRequestTime () + MIN_REQUEST_TIME) // try next floodfill if no response after min interval
229
+ if (ts > dest->GetLastRequestTime () + (dest->IsSentDirectly () ? MIN_DIRECT_REQUEST_TIME : MIN_REQUEST_TIME))
230
+ // try next floodfill if no response after min interval
226
231
done = !SendNextRequest (dest);
227
232
}
228
233
else // request is expired
0 commit comments