mirror of
https://github.com/PurpleI2P/i2pd
synced 2024-11-09 15:50:26 +03: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)
|
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)
|
if (m_Requests)
|
||||||
m_Requests->PostRequestDestination (destination, requestComplete, direct);
|
m_Requests->PostRequestDestination (destination, requestComplete, direct);
|
||||||
else
|
else
|
||||||
|
@ -177,6 +177,7 @@ namespace garlic
|
|||||||
void SetMTU (int mtu, bool v4);
|
void SetMTU (int mtu, bool v4);
|
||||||
void SetHidden(bool hide) { m_IsHiddenMode = hide; };
|
void SetHidden(bool hide) { m_IsHiddenMode = hide; };
|
||||||
bool IsHidden() const { return m_IsHiddenMode; };
|
bool IsHidden() const { return m_IsHiddenMode; };
|
||||||
|
bool IsLimitedConnectivity () const { return m_Status == eRouterStatusProxy; }; // TODO: implement other cases
|
||||||
i2p::crypto::NoiseSymmetricState& GetCurrentNoiseState () { return m_CurrentNoiseState; };
|
i2p::crypto::NoiseSymmetricState& GetCurrentNoiseState () { return m_CurrentNoiseState; };
|
||||||
|
|
||||||
void UpdateNTCP2V6Address (const boost::asio::ip::address& host); // called from Daemon. TODO: remove
|
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");
|
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
|
i2p::data::netdb.SetUnreachable (ident, true); // we are here because all connection attempts failed but router claimed them
|
||||||
peer->Done ();
|
peer->Done ();
|
||||||
std::unique_lock<std::mutex> l(m_PeersMutex);
|
std::unique_lock<std::mutex> l(m_PeersMutex);
|
||||||
|
Loading…
Reference in New Issue
Block a user