Browse Source

don't change router status if peer test came from recent endpoint

pull/2101/head
orignal 2 months ago
parent
commit
5324197e43
  1. 10
      libi2pd/SSU2Session.cpp

10
libi2pd/SSU2Session.cpp

@ -2365,12 +2365,13 @@ namespace transport @@ -2365,12 +2365,13 @@ namespace transport
if (addr)
{
it->second.first->m_Address = addr;
auto state = it->second.first->m_State;
auto& state = it->second.first->m_State;
if (state == eSSU2SessionStatePeerTestReceived || state == eSSU2SessionStateVoidPeerTestReceived)
{
// msg 5 already received. send msg 6
SetRouterStatus (state == eSSU2SessionStatePeerTestReceived ? eRouterStatusOK : eRouterStatusUnknown);
it->second.first->m_State = eSSU2SessionStatePeerTest;
if (state == eSSU2SessionStatePeerTestReceived)
SetRouterStatus (eRouterStatusOK);
state = eSSU2SessionStatePeerTest;
it->second.first->SendPeerTest (6, buf + offset, len - offset, addr->i);
}
else
@ -2430,7 +2431,8 @@ namespace transport @@ -2430,7 +2431,8 @@ namespace transport
bool isConnectedRecently = m_Server.IsConnectedRecently (m_RemoteEndpoint);
if (m_Address)
{
SetRouterStatus (isConnectedRecently ? eRouterStatusUnknown : eRouterStatusOK);
if (!isConnectedRecently)
SetRouterStatus (eRouterStatusOK);
SendPeerTest (6, buf + offset, len - offset, m_Address->i);
}
else

Loading…
Cancel
Save