mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-02-02 11:04:00 +01:00
Merge remote-tracking branch 'purple/openssl' into low-latency-merge
This commit is contained in:
commit
673a2acade
|
@ -52,7 +52,7 @@ namespace client
|
||||||
if (httpProxyKeys.length () > 0)
|
if (httpProxyKeys.length () > 0)
|
||||||
{
|
{
|
||||||
i2p::data::PrivateKeys keys;
|
i2p::data::PrivateKeys keys;
|
||||||
if(LoadPrivateKeys (keys, httpProxyKeys))
|
if(LoadPrivateKeys (keys, httpProxyKeys, i2p::data::SIGNING_KEY_TYPE_DSA_SHA1))
|
||||||
{
|
{
|
||||||
std::map<std::string, std::string> params;
|
std::map<std::string, std::string> params;
|
||||||
ReadI2CPOptionsFromConfig ("httpproxy.", params);
|
ReadI2CPOptionsFromConfig ("httpproxy.", params);
|
||||||
|
@ -82,7 +82,7 @@ namespace client
|
||||||
if (socksProxyKeys.length () > 0)
|
if (socksProxyKeys.length () > 0)
|
||||||
{
|
{
|
||||||
i2p::data::PrivateKeys keys;
|
i2p::data::PrivateKeys keys;
|
||||||
if (LoadPrivateKeys (keys, socksProxyKeys))
|
if (LoadPrivateKeys (keys, socksProxyKeys, i2p::data::SIGNING_KEY_TYPE_DSA_SHA1))
|
||||||
{
|
{
|
||||||
std::map<std::string, std::string> params;
|
std::map<std::string, std::string> params;
|
||||||
ReadI2CPOptionsFromConfig ("socksproxy.", params);
|
ReadI2CPOptionsFromConfig ("socksproxy.", params);
|
||||||
|
|
17
NetDb.cpp
17
NetDb.cpp
|
@ -188,25 +188,36 @@ namespace data
|
||||||
// TODO: check if floodfill has been changed
|
// TODO: check if floodfill has been changed
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
LogPrint (eLogDebug, "NetDb: RouterInfo is older: ", ident.ToBase64());
|
LogPrint (eLogDebug, "NetDb: RouterInfo is older: ", ident.ToBase64());
|
||||||
|
updated = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
r = std::make_shared<RouterInfo> (buf, len);
|
r = std::make_shared<RouterInfo> (buf, len);
|
||||||
if (!r->IsUnreachable ())
|
if (!r->IsUnreachable ())
|
||||||
{
|
{
|
||||||
LogPrint (eLogInfo, "NetDb: RouterInfo added: ", ident.ToBase64());
|
bool inserted = false;
|
||||||
{
|
{
|
||||||
std::unique_lock<std::mutex> l(m_RouterInfosMutex);
|
std::unique_lock<std::mutex> l(m_RouterInfosMutex);
|
||||||
m_RouterInfos[r->GetIdentHash ()] = r;
|
inserted = m_RouterInfos.insert ({r->GetIdentHash (), r}).second;
|
||||||
}
|
}
|
||||||
|
if (inserted)
|
||||||
|
{
|
||||||
|
LogPrint (eLogInfo, "NetDb: RouterInfo added: ", ident.ToBase64());
|
||||||
if (r->IsFloodfill () && r->IsReachable ()) // floodfill must be reachable
|
if (r->IsFloodfill () && r->IsReachable ()) // floodfill must be reachable
|
||||||
{
|
{
|
||||||
std::unique_lock<std::mutex> l(m_FloodfillsMutex);
|
std::unique_lock<std::mutex> l(m_FloodfillsMutex);
|
||||||
m_Floodfills.push_back (r);
|
m_Floodfills.push_back (r);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
LogPrint (eLogWarning, "NetDb: Duplicated RouterInfo ", ident.ToBase64());
|
||||||
|
updated = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
updated = false;
|
updated = false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -260,7 +260,8 @@ namespace transport
|
||||||
{
|
{
|
||||||
// we send it to ourself
|
// we send it to ourself
|
||||||
for (auto& it: msgs)
|
for (auto& it: msgs)
|
||||||
i2p::HandleI2NPMessage (it);
|
m_LoopbackHandler.PutNextMessage (it);
|
||||||
|
m_LoopbackHandler.Flush ();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if(RoutesRestricted() && ! IsRestrictedPeer(ident)) return;
|
if(RoutesRestricted() && ! IsRestrictedPeer(ident)) return;
|
||||||
|
|
|
@ -168,6 +168,8 @@ namespace transport
|
||||||
std::vector<i2p::data::IdentHash> m_TrustedRouters;
|
std::vector<i2p::data::IdentHash> m_TrustedRouters;
|
||||||
mutable std::mutex m_TrustedRoutersMutex;
|
mutable std::mutex m_TrustedRoutersMutex;
|
||||||
|
|
||||||
|
i2p::I2NPMessagesHandler m_LoopbackHandler;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
// for HTTP only
|
// for HTTP only
|
||||||
|
|
Loading…
Reference in a new issue