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

Loading…
Cancel
Save