mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-01-22 12:24:19 +00:00
start over if an active session got disconnected
This commit is contained in:
parent
60fd3a4542
commit
77189bf8e9
@ -647,12 +647,14 @@ namespace transport
|
|||||||
auto it = m_Peers.find (ident);
|
auto it = m_Peers.find (ident);
|
||||||
if (it != m_Peers.end ())
|
if (it != m_Peers.end ())
|
||||||
{
|
{
|
||||||
|
auto before = it->second.sessions.size ();
|
||||||
it->second.sessions.remove (session);
|
it->second.sessions.remove (session);
|
||||||
if (it->second.sessions.empty ()) // TODO: why?
|
if (it->second.sessions.empty ())
|
||||||
{
|
{
|
||||||
if (it->second.delayedMessages.size () > 0)
|
if (it->second.delayedMessages.size () > 0)
|
||||||
{
|
{
|
||||||
// it->second.numAttempts = 0; // TODO: recognize if connect failed
|
if (before > 0) // we had an active session before
|
||||||
|
it->second.numAttempts = 0; // start over
|
||||||
ConnectToPeer (ident, it->second);
|
ConnectToPeer (ident, it->second);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
Loading…
x
Reference in New Issue
Block a user