firewall detection

This commit is contained in:
orignal 2015-02-26 13:44:18 -05:00
parent 51aea367c3
commit 30715c2512
5 changed files with 28 additions and 2 deletions

View file

@ -902,10 +902,15 @@ namespace transport
case ePeerTestParticipantAlice1:
{
if (m_State == eSessionStateEstablished)
{
LogPrint (eLogDebug, "SSU peer test from Bob. We are Alice");
if (i2p::context.GetStatus () == eRouterStatusTesting) // still not OK
i2p::context.SetStatus (eRouterStatusFirewalled);
}
else
{
LogPrint (eLogDebug, "SSU first peer test from Charlie. We are Alice");
i2p::context.SetStatus (eRouterStatusOK);
m_Server.UpdatePeerTest (nonce, ePeerTestParticipantAlice2);
SendPeerTest (nonce, senderEndpoint.address ().to_v4 ().to_ulong (),
senderEndpoint.port (), introKey, true, false); // to Charlie
@ -920,6 +925,7 @@ namespace transport
{
// peer test successive
LogPrint (eLogDebug, "SSU second peer test from Charlie. We are Alice");
i2p::context.SetStatus (eRouterStatusOK);
m_Server.RemovePeerTest (nonce);
}
break;