pull/579/head
Jeff Becker 5 years ago
parent 4404d272b2
commit 5b49008bca
No known key found for this signature in database
GPG Key ID: F357B3B42F6F9B05

@ -16,8 +16,7 @@ namespace llarp
namespace hooks
{
#if defined(_WIN32)
Backend_ptr
ExecShellBackend(std::string)
Backend_ptr ExecShellBackend(std::string)
{
return nullptr;
}

@ -32,15 +32,15 @@ namespace llarp
return "";
return tmp;
}
template<>
std::string
template <>
std::string
huint16_t::ToString() const
{
return std::to_string(h);
}
template<>
std::string
template <>
std::string
nuint16_t::ToString() const
{
return std::to_string(ntohs(n));

@ -741,8 +741,7 @@ namespace llarp
{
if(router.IsZero())
return;
RouterContact rc;
if(!m_Router->nodedb()->Get(router, rc))
if(!m_Router->nodedb()->Has(router))
{
LookupRouterAnon(router);
}
@ -880,9 +879,13 @@ namespace llarp
if(!f.Sign(crypto(), m_Identity))
return false;
auto d =
std::make_shared< const routing::PathTransferMessage >(f, frame.F);
RouterLogic()->queue_func([=]() { p->SendRoutingMessage(*d, router); });
{
util::Lock lock(&m_SendQueueMutex);
m_SendQueue.emplace_back(
std::make_shared< const routing::PathTransferMessage >(f,
frame.F),
p);
}
return true;
}
return true;
@ -1156,20 +1159,20 @@ namespace llarp
bool
Endpoint::ShouldBuildMore(llarp_time_t now) const
{
bool should = path::Builder::ShouldBuildMore(now);
const bool should = path::Builder::ShouldBuildMore(now);
// determine newest intro
Introduction intro;
if(!GetNewestIntro(intro))
return should;
// time from now that the newest intro expires at
if(now >= intro.expiresAt)
if(intro.ExpiresSoon(now))
return should;
auto dlt = now - intro.expiresAt;
const auto dlt = now - intro.expiresAt;
return should
|| ( // try spacing tunnel builds out evenly in time
(dlt < (path::default_lifetime / 2))
(dlt > (path::default_lifetime / 4))
&& (NumInStatus(path::ePathBuilding) < m_NumPaths)
&& (dlt > buildIntervalLimit));
&& (dlt >= buildIntervalLimit));
}
Logic*

@ -298,8 +298,7 @@ namespace llarp
}
}
// lookup router in intro if set and unknown
if(!remoteIntro.router.IsZero())
m_Endpoint->EnsureRouterIsKnown(remoteIntro.router);
m_Endpoint->EnsureRouterIsKnown(remoteIntro.router);
// expire bad intros
auto itr = m_BadIntros.begin();
while(itr != m_BadIntros.end())
@ -322,7 +321,6 @@ namespace llarp
tmp.Randomize();
llarp_buffer_t buf(tmp.data(), tmp.size());
AsyncEncryptAndSendTo(buf, eProtocolControl);
SharedSecret k;
if(currentConvoTag.IsZero())
return false;
return !m_DataHandler->HasConvoTag(currentConvoTag);

@ -101,7 +101,6 @@ namespace llarp
LogError("No cached session key");
return;
}
++sequenceNo;
Send(f, path);
}

Loading…
Cancel
Save