mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-01-22 13:27:17 +01:00
limited connectivity mode
This commit is contained in:
parent
d539c9677e
commit
8d1c186665
|
@ -759,7 +759,8 @@ namespace data
|
|||
|
||||
void NetDb::RequestDestination (const IdentHash& destination, RequestedDestination::RequestComplete requestComplete, bool direct)
|
||||
{
|
||||
if (direct && i2p::transport::transports.RoutesRestricted ()) direct = false; // always use tunnels for restricted routes
|
||||
if (direct && (i2p::transport::transports.RoutesRestricted () || i2p::context.IsLimitedConnectivity ()))
|
||||
direct = false; // always use tunnels for restricted routes or limited connectivity
|
||||
if (m_Requests)
|
||||
m_Requests->PostRequestDestination (destination, requestComplete, direct);
|
||||
else
|
||||
|
|
|
@ -177,6 +177,7 @@ namespace garlic
|
|||
void SetMTU (int mtu, bool v4);
|
||||
void SetHidden(bool hide) { m_IsHiddenMode = hide; };
|
||||
bool IsHidden() const { return m_IsHiddenMode; };
|
||||
bool IsLimitedConnectivity () const { return m_Status == eRouterStatusProxy; }; // TODO: implement other cases
|
||||
i2p::crypto::NoiseSymmetricState& GetCurrentNoiseState () { return m_CurrentNoiseState; };
|
||||
|
||||
void UpdateNTCP2V6Address (const boost::asio::ip::address& host); // called from Daemon. TODO: remove
|
||||
|
|
|
@ -599,7 +599,7 @@ namespace transport
|
|||
}
|
||||
|
||||
LogPrint (eLogInfo, "Transports: No compatible addresses available");
|
||||
if (peer->router->IsReachableFrom (i2p::context.GetRouterInfo ()))
|
||||
if (!i2p::context.IsLimitedConnectivity () && peer->router->IsReachableFrom (i2p::context.GetRouterInfo ()))
|
||||
i2p::data::netdb.SetUnreachable (ident, true); // we are here because all connection attempts failed but router claimed them
|
||||
peer->Done ();
|
||||
std::unique_lock<std::mutex> l(m_PeersMutex);
|
||||
|
|
Loading…
Reference in a new issue