mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-01-21 11:29:56 +00:00
exluded SSU from transports
This commit is contained in:
parent
6a23153c0b
commit
379075c594
@ -298,15 +298,14 @@ namespace util
|
|||||||
|
|
||||||
bool ntcp2; i2p::config::GetOption("ntcp2.enabled", ntcp2);
|
bool ntcp2; i2p::config::GetOption("ntcp2.enabled", ntcp2);
|
||||||
bool ssu2; i2p::config::GetOption("ssu2.enabled", ssu2);
|
bool ssu2; i2p::config::GetOption("ssu2.enabled", ssu2);
|
||||||
bool ssu; i2p::config::GetOption("ssu", ssu);
|
|
||||||
bool checkInReserved; i2p::config::GetOption("reservedrange", checkInReserved);
|
bool checkInReserved; i2p::config::GetOption("reservedrange", checkInReserved);
|
||||||
LogPrint(eLogInfo, "Daemon: Starting Transports");
|
LogPrint(eLogInfo, "Daemon: Starting Transports");
|
||||||
if(!ssu) LogPrint(eLogInfo, "Daemon: SSU disabled");
|
if(!ssu2) LogPrint(eLogInfo, "Daemon: SSU2 disabled");
|
||||||
if(!ntcp2) LogPrint(eLogInfo, "Daemon: NTCP2 disabled");
|
if(!ntcp2) LogPrint(eLogInfo, "Daemon: NTCP2 disabled");
|
||||||
|
|
||||||
i2p::transport::transports.SetCheckReserved(checkInReserved);
|
i2p::transport::transports.SetCheckReserved(checkInReserved);
|
||||||
i2p::transport::transports.Start(ntcp2, ssu, ssu2);
|
i2p::transport::transports.Start(ntcp2, ssu2);
|
||||||
if (i2p::transport::transports.IsBoundSSU() || i2p::transport::transports.IsBoundSSU2() || i2p::transport::transports.IsBoundNTCP2())
|
if (i2p::transport::transports.IsBoundSSU2() || i2p::transport::transports.IsBoundNTCP2())
|
||||||
LogPrint(eLogInfo, "Daemon: Transports started");
|
LogPrint(eLogInfo, "Daemon: Transports started");
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -843,46 +843,6 @@ namespace http {
|
|||||||
if (!sessions.empty ())
|
if (!sessions.empty ())
|
||||||
ShowTransportSessions (s, sessions, "NTCP2");
|
ShowTransportSessions (s, sessions, "NTCP2");
|
||||||
}
|
}
|
||||||
auto ssuServer = i2p::transport::transports.GetSSUServer ();
|
|
||||||
if (ssuServer)
|
|
||||||
{
|
|
||||||
auto sessions = ssuServer->GetSessions ();
|
|
||||||
if (!sessions.empty ())
|
|
||||||
{
|
|
||||||
s << "<div class='slide'><label for='slide_ssu'><b>SSU</b> ( " << (int) sessions.size() << " )</label>\r\n<input type=\"checkbox\" id=\"slide_ssu\" />\r\n<div class=\"slidecontent list\">";
|
|
||||||
for (const auto& it: sessions)
|
|
||||||
{
|
|
||||||
s << "<div class=\"listitem\">\r\n";
|
|
||||||
auto endpoint = it.second->GetRemoteEndpoint ();
|
|
||||||
if (it.second->IsOutgoing ()) s << " ⇒ ";
|
|
||||||
s << endpoint.address ().to_string () << ":" << endpoint.port ();
|
|
||||||
if (!it.second->IsOutgoing ()) s << " ⇒ ";
|
|
||||||
s << " [" << it.second->GetNumSentBytes () << ":" << it.second->GetNumReceivedBytes () << "]";
|
|
||||||
if (it.second->GetRelayTag ())
|
|
||||||
s << " [itag:" << it.second->GetRelayTag () << "]";
|
|
||||||
s << "</div>\r\n" << std::endl;
|
|
||||||
}
|
|
||||||
s << "</div>\r\n</div>\r\n";
|
|
||||||
}
|
|
||||||
auto sessions6 = ssuServer->GetSessionsV6 ();
|
|
||||||
if (!sessions6.empty ())
|
|
||||||
{
|
|
||||||
s << "<div class='slide'><label for='slide_ssuv6'><b>SSUv6</b> ( " << (int) sessions6.size() << " )</label>\r\n<input type=\"checkbox\" id=\"slide_ssuv6\" />\r\n<div class=\"slidecontent list\">";
|
|
||||||
for (const auto& it: sessions6)
|
|
||||||
{
|
|
||||||
s << "<div class=\"listitem\">\r\n";
|
|
||||||
auto endpoint = it.second->GetRemoteEndpoint ();
|
|
||||||
if (it.second->IsOutgoing ()) s << " ⇒ ";
|
|
||||||
s << "[" << endpoint.address ().to_string () << "]:" << endpoint.port ();
|
|
||||||
if (!it.second->IsOutgoing ()) s << " ⇒ ";
|
|
||||||
s << " [" << it.second->GetNumSentBytes () << ":" << it.second->GetNumReceivedBytes () << "]";
|
|
||||||
if (it.second->GetRelayTag ())
|
|
||||||
s << " [itag:" << it.second->GetRelayTag () << "]";
|
|
||||||
s << "</div>\r\n" << std::endl;
|
|
||||||
}
|
|
||||||
s << "</div>\r\n</div>\r\n";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
auto ssu2Server = i2p::transport::transports.GetSSU2Server ();
|
auto ssu2Server = i2p::transport::transports.GetSSU2Server ();
|
||||||
if (ssu2Server)
|
if (ssu2Server)
|
||||||
{
|
{
|
||||||
|
@ -64,7 +64,7 @@ namespace config {
|
|||||||
("bandwidth", value<std::string>()->default_value(""), "Transit traffic bandwidth limit: integer in KBps or letters: L (32), O (256), P (2048), X (>9000)")
|
("bandwidth", value<std::string>()->default_value(""), "Transit traffic bandwidth limit: integer in KBps or letters: L (32), O (256), P (2048), X (>9000)")
|
||||||
("share", value<int>()->default_value(100), "Limit of transit traffic from max bandwidth in percents. (default: 100)")
|
("share", value<int>()->default_value(100), "Limit of transit traffic from max bandwidth in percents. (default: 100)")
|
||||||
("ntcp", bool_switch()->default_value(false), "Ignored. Always false")
|
("ntcp", bool_switch()->default_value(false), "Ignored. Always false")
|
||||||
("ssu", bool_switch()->default_value(false), "Enable SSU transport (default: disabled)")
|
("ssu", bool_switch()->default_value(false), "Ignored. Always false")
|
||||||
("ntcpproxy", value<std::string>()->default_value(""), "Ignored")
|
("ntcpproxy", value<std::string>()->default_value(""), "Ignored")
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
("svcctl", value<std::string>()->default_value(""), "Ignored")
|
("svcctl", value<std::string>()->default_value(""), "Ignored")
|
||||||
|
@ -136,7 +136,7 @@ namespace transport
|
|||||||
Transports::Transports ():
|
Transports::Transports ():
|
||||||
m_IsOnline (true), m_IsRunning (false), m_IsNAT (true), m_CheckReserved(true), m_Thread (nullptr),
|
m_IsOnline (true), m_IsRunning (false), m_IsNAT (true), m_CheckReserved(true), m_Thread (nullptr),
|
||||||
m_Service (nullptr), m_Work (nullptr), m_PeerCleanupTimer (nullptr), m_PeerTestTimer (nullptr),
|
m_Service (nullptr), m_Work (nullptr), m_PeerCleanupTimer (nullptr), m_PeerTestTimer (nullptr),
|
||||||
m_SSUServer (nullptr), m_SSU2Server (nullptr), m_NTCP2Server (nullptr),
|
m_SSU2Server (nullptr), m_NTCP2Server (nullptr),
|
||||||
m_X25519KeysPairSupplier (15), // 15 pre-generated keys
|
m_X25519KeysPairSupplier (15), // 15 pre-generated keys
|
||||||
m_TotalSentBytes(0), m_TotalReceivedBytes(0), m_TotalTransitTransmittedBytes (0),
|
m_TotalSentBytes(0), m_TotalReceivedBytes(0), m_TotalTransitTransmittedBytes (0),
|
||||||
m_InBandwidth (0), m_OutBandwidth (0), m_TransitBandwidth(0),
|
m_InBandwidth (0), m_OutBandwidth (0), m_TransitBandwidth(0),
|
||||||
@ -157,7 +157,7 @@ namespace transport
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Transports::Start (bool enableNTCP2, bool enableSSU, bool enableSSU2)
|
void Transports::Start (bool enableNTCP2, bool enableSSU2)
|
||||||
{
|
{
|
||||||
if (!m_Service)
|
if (!m_Service)
|
||||||
{
|
{
|
||||||
@ -205,22 +205,6 @@ namespace transport
|
|||||||
m_NTCP2Server = new NTCP2Server ();
|
m_NTCP2Server = new NTCP2Server ();
|
||||||
}
|
}
|
||||||
|
|
||||||
// create SSU server
|
|
||||||
int ssuPort = 0;
|
|
||||||
if (enableSSU)
|
|
||||||
{
|
|
||||||
auto& addresses = context.GetRouterInfo ().GetAddresses ();
|
|
||||||
for (const auto& address: addresses)
|
|
||||||
{
|
|
||||||
if (!address) continue;
|
|
||||||
if (address->transportStyle == RouterInfo::eTransportSSU)
|
|
||||||
{
|
|
||||||
ssuPort = address->port;
|
|
||||||
m_SSUServer = new SSUServer (address->port);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// create SSU2 server
|
// create SSU2 server
|
||||||
if (enableSSU2)
|
if (enableSSU2)
|
||||||
{
|
{
|
||||||
@ -255,7 +239,6 @@ namespace transport
|
|||||||
if (!ec)
|
if (!ec)
|
||||||
{
|
{
|
||||||
if (m_NTCP2Server) m_NTCP2Server->SetLocalAddress (addr);
|
if (m_NTCP2Server) m_NTCP2Server->SetLocalAddress (addr);
|
||||||
if (m_SSUServer) m_SSUServer->SetLocalAddress (addr);
|
|
||||||
if (m_SSU2Server) m_SSU2Server->SetLocalAddress (addr);
|
if (m_SSU2Server) m_SSU2Server->SetLocalAddress (addr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -282,7 +265,6 @@ namespace transport
|
|||||||
if (!ec)
|
if (!ec)
|
||||||
{
|
{
|
||||||
if (m_NTCP2Server) m_NTCP2Server->SetLocalAddress (addr);
|
if (m_NTCP2Server) m_NTCP2Server->SetLocalAddress (addr);
|
||||||
if (m_SSUServer) m_SSUServer->SetLocalAddress (addr);
|
|
||||||
if (m_SSU2Server) m_SSU2Server->SetLocalAddress (addr);
|
if (m_SSU2Server) m_SSU2Server->SetLocalAddress (addr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -315,22 +297,7 @@ namespace transport
|
|||||||
// start servers
|
// start servers
|
||||||
if (m_NTCP2Server) m_NTCP2Server->Start ();
|
if (m_NTCP2Server) m_NTCP2Server->Start ();
|
||||||
if (m_SSU2Server) m_SSU2Server->Start ();
|
if (m_SSU2Server) m_SSU2Server->Start ();
|
||||||
if (m_SSUServer)
|
if (m_SSU2Server) DetectExternalIP ();
|
||||||
{
|
|
||||||
LogPrint (eLogInfo, "Transports: Start listening UDP port ", ssuPort);
|
|
||||||
try
|
|
||||||
{
|
|
||||||
m_SSUServer->Start ();
|
|
||||||
}
|
|
||||||
catch (std::exception& ex )
|
|
||||||
{
|
|
||||||
LogPrint(eLogError, "Transports: Failed to bind to UDP port", ssuPort);
|
|
||||||
m_SSUServer->Stop ();
|
|
||||||
delete m_SSUServer;
|
|
||||||
m_SSUServer = nullptr;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (m_SSUServer || m_SSU2Server) DetectExternalIP ();
|
|
||||||
|
|
||||||
m_PeerCleanupTimer->expires_from_now (boost::posix_time::seconds(5*SESSION_CREATION_TIMEOUT));
|
m_PeerCleanupTimer->expires_from_now (boost::posix_time::seconds(5*SESSION_CREATION_TIMEOUT));
|
||||||
m_PeerCleanupTimer->async_wait (std::bind (&Transports::HandlePeerCleanupTimer, this, std::placeholders::_1));
|
m_PeerCleanupTimer->async_wait (std::bind (&Transports::HandlePeerCleanupTimer, this, std::placeholders::_1));
|
||||||
@ -347,12 +314,6 @@ namespace transport
|
|||||||
if (m_PeerCleanupTimer) m_PeerCleanupTimer->cancel ();
|
if (m_PeerCleanupTimer) m_PeerCleanupTimer->cancel ();
|
||||||
if (m_PeerTestTimer) m_PeerTestTimer->cancel ();
|
if (m_PeerTestTimer) m_PeerTestTimer->cancel ();
|
||||||
m_Peers.clear ();
|
m_Peers.clear ();
|
||||||
if (m_SSUServer)
|
|
||||||
{
|
|
||||||
m_SSUServer->Stop ();
|
|
||||||
delete m_SSUServer;
|
|
||||||
m_SSUServer = nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (m_SSU2Server)
|
if (m_SSU2Server)
|
||||||
{
|
{
|
||||||
@ -538,21 +499,6 @@ namespace transport
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case i2p::data::RouterInfo::eSSUV4:
|
|
||||||
case i2p::data::RouterInfo::eSSUV6:
|
|
||||||
{
|
|
||||||
if (!m_SSUServer) continue;
|
|
||||||
std::shared_ptr<const RouterInfo::Address> address = (tr == i2p::data::RouterInfo::eSSUV6) ?
|
|
||||||
peer.router->GetSSUV6Address () : peer.router->GetSSUAddress (true);
|
|
||||||
if (address && m_CheckReserved && i2p::util::net::IsInReservedRange(address->host))
|
|
||||||
address = nullptr;
|
|
||||||
if (address && address->IsReachableSSU ())
|
|
||||||
{
|
|
||||||
if (m_SSUServer->CreateSession (peer.router, address))
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case i2p::data::RouterInfo::eNTCP2V6Mesh:
|
case i2p::data::RouterInfo::eNTCP2V6Mesh:
|
||||||
{
|
{
|
||||||
if (!m_NTCP2Server) continue;
|
if (!m_NTCP2Server) continue;
|
||||||
@ -595,9 +541,7 @@ namespace transport
|
|||||||
i2p::data::RouterInfo::eNTCP2V4,
|
i2p::data::RouterInfo::eNTCP2V4,
|
||||||
i2p::data::RouterInfo::eSSU2V6,
|
i2p::data::RouterInfo::eSSU2V6,
|
||||||
i2p::data::RouterInfo::eSSU2V4,
|
i2p::data::RouterInfo::eSSU2V4,
|
||||||
i2p::data::RouterInfo::eNTCP2V6Mesh,
|
i2p::data::RouterInfo::eNTCP2V6Mesh
|
||||||
i2p::data::RouterInfo::eSSUV6,
|
|
||||||
i2p::data::RouterInfo::eSSUV4
|
|
||||||
},
|
},
|
||||||
ssu2Priority =
|
ssu2Priority =
|
||||||
{
|
{
|
||||||
@ -605,9 +549,7 @@ namespace transport
|
|||||||
i2p::data::RouterInfo::eSSU2V4,
|
i2p::data::RouterInfo::eSSU2V4,
|
||||||
i2p::data::RouterInfo::eNTCP2V6,
|
i2p::data::RouterInfo::eNTCP2V6,
|
||||||
i2p::data::RouterInfo::eNTCP2V4,
|
i2p::data::RouterInfo::eNTCP2V4,
|
||||||
i2p::data::RouterInfo::eNTCP2V6Mesh,
|
i2p::data::RouterInfo::eNTCP2V6Mesh
|
||||||
i2p::data::RouterInfo::eSSUV6,
|
|
||||||
i2p::data::RouterInfo::eSSUV4
|
|
||||||
};
|
};
|
||||||
if (!peer.router) return;
|
if (!peer.router) return;
|
||||||
auto compatibleTransports = context.GetRouterInfo ().GetCompatibleTransports (false) &
|
auto compatibleTransports = context.GetRouterInfo ().GetCompatibleTransports (false) &
|
||||||
@ -654,7 +596,7 @@ namespace transport
|
|||||||
i2p::context.SetStatus (eRouterStatusOK);
|
i2p::context.SetStatus (eRouterStatusOK);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (m_SSUServer || m_SSU2Server)
|
if (m_SSU2Server)
|
||||||
PeerTest ();
|
PeerTest ();
|
||||||
else
|
else
|
||||||
LogPrint (eLogWarning, "Transports: Can't detect external IP. SSU or SSU2 is not available");
|
LogPrint (eLogWarning, "Transports: Can't detect external IP. SSU or SSU2 is not available");
|
||||||
@ -662,103 +604,44 @@ namespace transport
|
|||||||
|
|
||||||
void Transports::PeerTest (bool ipv4, bool ipv6)
|
void Transports::PeerTest (bool ipv4, bool ipv6)
|
||||||
{
|
{
|
||||||
if (RoutesRestricted() || (!m_SSUServer && !m_SSU2Server)) return;
|
if (RoutesRestricted() || !m_SSU2Server || m_SSU2Server->UsesProxy ()) return;
|
||||||
if (ipv4 && i2p::context.SupportsV4 ())
|
if (ipv4 && i2p::context.SupportsV4 ())
|
||||||
{
|
{
|
||||||
LogPrint (eLogInfo, "Transports: Started peer test IPv4");
|
LogPrint (eLogInfo, "Transports: Started peer test IPv4");
|
||||||
std::set<i2p::data::IdentHash> excluded;
|
std::set<i2p::data::IdentHash> excluded;
|
||||||
excluded.insert (i2p::context.GetIdentHash ()); // don't pick own router
|
excluded.insert (i2p::context.GetIdentHash ()); // don't pick own router
|
||||||
if (m_SSUServer)
|
for (int i = 0; i < 5; i++)
|
||||||
{
|
{
|
||||||
bool statusChanged = false;
|
auto router = i2p::data::netdb.GetRandomSSU2PeerTestRouter (true, excluded); // v4
|
||||||
for (int i = 0; i < 5; i++)
|
if (router)
|
||||||
{
|
{
|
||||||
auto router = i2p::data::netdb.GetRandomPeerTestRouter (true, excluded); // v4
|
if (i2p::context.GetStatus () != eRouterStatusTesting)
|
||||||
if (router)
|
i2p::context.SetStatusSSU2 (eRouterStatusTesting);
|
||||||
{
|
m_SSU2Server->StartPeerTest (router, true);
|
||||||
auto addr = router->GetSSUAddress (true); // ipv4
|
excluded.insert (router->GetIdentHash ());
|
||||||
if (addr && !i2p::util::net::IsInReservedRange(addr->host))
|
|
||||||
{
|
|
||||||
if (!statusChanged)
|
|
||||||
{
|
|
||||||
statusChanged = true;
|
|
||||||
i2p::context.SetStatus (eRouterStatusTesting); // first time only
|
|
||||||
}
|
|
||||||
m_SSUServer->CreateSession (router, addr, true); // peer test v4
|
|
||||||
}
|
|
||||||
excluded.insert (router->GetIdentHash ());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (!statusChanged)
|
|
||||||
LogPrint (eLogWarning, "Transports: Can't find routers for peer test IPv4");
|
|
||||||
}
|
|
||||||
// SSU2
|
|
||||||
if (m_SSU2Server && !m_SSU2Server->UsesProxy ())
|
|
||||||
{
|
|
||||||
excluded.clear ();
|
|
||||||
excluded.insert (i2p::context.GetIdentHash ());
|
|
||||||
int numTests = m_SSUServer ? 3 : 5;
|
|
||||||
for (int i = 0; i < numTests; i++)
|
|
||||||
{
|
|
||||||
auto router = i2p::data::netdb.GetRandomSSU2PeerTestRouter (true, excluded); // v4
|
|
||||||
if (router)
|
|
||||||
{
|
|
||||||
if (i2p::context.GetStatus () != eRouterStatusTesting)
|
|
||||||
i2p::context.SetStatusSSU2 (eRouterStatusTesting);
|
|
||||||
m_SSU2Server->StartPeerTest (router, true);
|
|
||||||
excluded.insert (router->GetIdentHash ());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (excluded.size () <= 1)
|
||||||
|
LogPrint (eLogWarning, "Transports: Can't find routers for peer test IPv4");
|
||||||
}
|
}
|
||||||
if (ipv6 && i2p::context.SupportsV6 ())
|
if (ipv6 && i2p::context.SupportsV6 ())
|
||||||
{
|
{
|
||||||
LogPrint (eLogInfo, "Transports: Started peer test IPv6");
|
LogPrint (eLogInfo, "Transports: Started peer test IPv6");
|
||||||
std::set<i2p::data::IdentHash> excluded;
|
std::set<i2p::data::IdentHash> excluded;
|
||||||
excluded.insert (i2p::context.GetIdentHash ()); // don't pick own router
|
excluded.insert (i2p::context.GetIdentHash ()); // don't pick own router
|
||||||
if (m_SSUServer)
|
for (int i = 0; i < 5; i++)
|
||||||
{
|
{
|
||||||
bool statusChanged = false;
|
auto router = i2p::data::netdb.GetRandomSSU2PeerTestRouter (false, excluded); // v6
|
||||||
for (int i = 0; i < 5; i++)
|
if (router)
|
||||||
{
|
{
|
||||||
auto router = i2p::data::netdb.GetRandomPeerTestRouter (false, excluded); // v6
|
if (i2p::context.GetStatusV6 () != eRouterStatusTesting)
|
||||||
if (router)
|
i2p::context.SetStatusV6SSU2 (eRouterStatusTesting);
|
||||||
{
|
m_SSU2Server->StartPeerTest (router, false);
|
||||||
auto addr = router->GetSSUV6Address ();
|
excluded.insert (router->GetIdentHash ());
|
||||||
if (addr && !i2p::util::net::IsInReservedRange(addr->host))
|
|
||||||
{
|
|
||||||
if (!statusChanged)
|
|
||||||
{
|
|
||||||
statusChanged = true;
|
|
||||||
i2p::context.SetStatusV6 (eRouterStatusTesting); // first time only
|
|
||||||
}
|
|
||||||
m_SSUServer->CreateSession (router, addr, true); // peer test v6
|
|
||||||
}
|
|
||||||
excluded.insert (router->GetIdentHash ());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (!statusChanged)
|
|
||||||
LogPrint (eLogWarning, "Transports: Can't find routers for peer test IPv6");
|
|
||||||
}
|
|
||||||
|
|
||||||
// SSU2
|
|
||||||
if (m_SSU2Server && !m_SSU2Server->UsesProxy ())
|
|
||||||
{
|
|
||||||
excluded.clear ();
|
|
||||||
excluded.insert (i2p::context.GetIdentHash ());
|
|
||||||
int numTests = m_SSUServer ? 3 : 5;
|
|
||||||
for (int i = 0; i < numTests; i++)
|
|
||||||
{
|
|
||||||
auto router = i2p::data::netdb.GetRandomSSU2PeerTestRouter (false, excluded); // v6
|
|
||||||
if (router)
|
|
||||||
{
|
|
||||||
if (i2p::context.GetStatusV6 () != eRouterStatusTesting)
|
|
||||||
i2p::context.SetStatusV6SSU2 (eRouterStatusTesting);
|
|
||||||
m_SSU2Server->StartPeerTest (router, false);
|
|
||||||
excluded.insert (router->GetIdentHash ());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (excluded.size () <= 1)
|
||||||
|
LogPrint (eLogWarning, "Transports: Can't find routers for peer test IPv6");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -21,7 +21,6 @@
|
|||||||
#include <atomic>
|
#include <atomic>
|
||||||
#include <boost/asio.hpp>
|
#include <boost/asio.hpp>
|
||||||
#include "TransportSession.h"
|
#include "TransportSession.h"
|
||||||
#include "SSU.h"
|
|
||||||
#include "SSU2.h"
|
#include "SSU2.h"
|
||||||
#include "NTCP2.h"
|
#include "NTCP2.h"
|
||||||
#include "RouterInfo.h"
|
#include "RouterInfo.h"
|
||||||
@ -96,10 +95,9 @@ namespace transport
|
|||||||
Transports ();
|
Transports ();
|
||||||
~Transports ();
|
~Transports ();
|
||||||
|
|
||||||
void Start (bool enableNTCP2=true, bool enableSSU=true, bool enableSSU2=false);
|
void Start (bool enableNTCP2=true, bool enableSSU2=true);
|
||||||
void Stop ();
|
void Stop ();
|
||||||
|
|
||||||
bool IsBoundSSU() const { return m_SSUServer != nullptr; }
|
|
||||||
bool IsBoundSSU2() const { return m_SSU2Server != nullptr; }
|
bool IsBoundSSU2() const { return m_SSU2Server != nullptr; }
|
||||||
bool IsBoundNTCP2() const { return m_NTCP2Server != nullptr; }
|
bool IsBoundNTCP2() const { return m_NTCP2Server != nullptr; }
|
||||||
|
|
||||||
@ -170,7 +168,6 @@ namespace transport
|
|||||||
boost::asio::io_service::work * m_Work;
|
boost::asio::io_service::work * m_Work;
|
||||||
boost::asio::deadline_timer * m_PeerCleanupTimer, * m_PeerTestTimer;
|
boost::asio::deadline_timer * m_PeerCleanupTimer, * m_PeerTestTimer;
|
||||||
|
|
||||||
SSUServer * m_SSUServer;
|
|
||||||
SSU2Server * m_SSU2Server;
|
SSU2Server * m_SSU2Server;
|
||||||
NTCP2Server * m_NTCP2Server;
|
NTCP2Server * m_NTCP2Server;
|
||||||
mutable std::mutex m_PeersMutex;
|
mutable std::mutex m_PeersMutex;
|
||||||
@ -196,7 +193,6 @@ namespace transport
|
|||||||
public:
|
public:
|
||||||
|
|
||||||
// for HTTP only
|
// for HTTP only
|
||||||
const SSUServer * GetSSUServer () const { return m_SSUServer; };
|
|
||||||
const NTCP2Server * GetNTCP2Server () const { return m_NTCP2Server; };
|
const NTCP2Server * GetNTCP2Server () const { return m_NTCP2Server; };
|
||||||
const SSU2Server * GetSSU2Server () const { return m_SSU2Server; };
|
const SSU2Server * GetSSU2Server () const { return m_SSU2Server; };
|
||||||
const decltype(m_Peers)& GetPeers () const { return m_Peers; };
|
const decltype(m_Peers)& GetPeers () const { return m_Peers; };
|
||||||
|
Loading…
x
Reference in New Issue
Block a user