mirror of
https://github.com/PurpleI2P/i2pd
synced 2024-11-10 00:00:29 +03:00
handle siuatuion if only one lease in remote LeaseSet
This commit is contained in:
parent
13b2fc3266
commit
ca4db7aab2
@ -1460,17 +1460,20 @@ namespace stream
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!updated && leases.size () > 1)
|
if (!updated)
|
||||||
{
|
{
|
||||||
uint32_t i = m_LocalDestination.GetRandom () % leases.size ();
|
uint32_t i = m_LocalDestination.GetRandom () % leases.size ();
|
||||||
if (m_CurrentRemoteLease && leases[i]->tunnelID == m_CurrentRemoteLease->tunnelID)
|
if (m_CurrentRemoteLease && leases[i]->tunnelID == m_CurrentRemoteLease->tunnelID)
|
||||||
|
{
|
||||||
// make sure we don't select previous
|
// make sure we don't select previous
|
||||||
|
if (leases.size () > 1)
|
||||||
i = (i + 1) % leases.size (); // if so, pick next
|
i = (i + 1) % leases.size (); // if so, pick next
|
||||||
m_CurrentRemoteLease = leases[i];
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
isLeaseChanged = false;
|
isLeaseChanged = false;
|
||||||
}
|
}
|
||||||
|
m_CurrentRemoteLease = leases[i];
|
||||||
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
LogPrint (eLogWarning, "Streaming: All remote leases are expired");
|
LogPrint (eLogWarning, "Streaming: All remote leases are expired");
|
||||||
|
Loading…
Reference in New Issue
Block a user