|
|
|
@ -1073,7 +1073,10 @@ namespace transport
@@ -1073,7 +1073,10 @@ namespace transport
|
|
|
|
|
LogPrint (eLogDebug, "SSU: peer test from Charlie. We are Bob"); |
|
|
|
|
auto session = m_Server.GetPeerTestSession (nonce); // session with Alice from PeerTest
|
|
|
|
|
if (session && session->m_State == eSessionStateEstablished) |
|
|
|
|
session->Send (PAYLOAD_TYPE_PEER_TEST, buf, len); // back to Alice
|
|
|
|
|
{ |
|
|
|
|
const auto& ep = session->GetRemoteEndpoint (); // Alice's endpoint as known to Bob
|
|
|
|
|
session->SendPeerTest (nonce, ep.address (), ep.port (), introKey, false, true); // send back to Alice
|
|
|
|
|
} |
|
|
|
|
m_Server.RemovePeerTest (nonce); // nonce has been used
|
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
@ -1093,10 +1096,13 @@ namespace transport
@@ -1093,10 +1096,13 @@ namespace transport
|
|
|
|
|
if (port) |
|
|
|
|
{ |
|
|
|
|
LogPrint (eLogDebug, "SSU: peer test from Bob. We are Charlie"); |
|
|
|
|
m_Server.NewPeerTest (nonce, ePeerTestParticipantCharlie); |
|
|
|
|
Send (PAYLOAD_TYPE_PEER_TEST, buf, len); // back to Bob
|
|
|
|
|
if (!addr.is_unspecified () && !i2p::util::net::IsInReservedRange(addr)) |
|
|
|
|
{ |
|
|
|
|
m_Server.NewPeerTest (nonce, ePeerTestParticipantCharlie); |
|
|
|
|
SendPeerTest (nonce, addr, port, introKey); // to Alice with her address received from Bob
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
LogPrint (eLogDebug, "SSU: peer test from Alice. We are Bob"); |
|
|
|
|