|
|
@ -384,13 +384,25 @@ namespace transport |
|
|
|
|
|
|
|
|
|
|
|
void Transports::DetectExternalIP () |
|
|
|
void Transports::DetectExternalIP () |
|
|
|
{ |
|
|
|
{ |
|
|
|
i2p::context.SetStatus (eRouterStatusTesting); |
|
|
|
if (m_SSUServer) |
|
|
|
for (int i = 0; i < 5; i++) |
|
|
|
|
|
|
|
{ |
|
|
|
{ |
|
|
|
auto router = i2p::data::netdb.GetRandomRouter (); |
|
|
|
i2p::context.SetStatus (eRouterStatusTesting); |
|
|
|
if (router && router->IsSSU () && m_SSUServer) |
|
|
|
for (int i = 0; i < 5; i++) |
|
|
|
m_SSUServer->GetSession (router, true); // peer test
|
|
|
|
{ |
|
|
|
} |
|
|
|
auto router = i2p::data::netdb.GetRandomPeerTestRouter (); |
|
|
|
|
|
|
|
if (router) |
|
|
|
|
|
|
|
m_SSUServer->GetSession (router, true); // peer test
|
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
// if not peer test capable routers found pick any
|
|
|
|
|
|
|
|
router = i2p::data::netdb.GetRandomRouter (); |
|
|
|
|
|
|
|
if (router && router->IsSSU ()) |
|
|
|
|
|
|
|
m_SSUServer->GetSession (router); // no peer test
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
LogPrint (eLogError, "Can't detect external IP. SSU is not available"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
DHKeysPair * Transports::GetNextDHKeysPair () |
|
|
|
DHKeysPair * Transports::GetNextDHKeysPair () |
|
|
|