pull/18/head
Jeff Becker 6 years ago
parent fa5389cb05
commit 869b758365
No known key found for this signature in database
GPG Key ID: F357B3B42F6F9B05

@ -191,8 +191,8 @@ namespace llarp
uint64_t sequenceNo = 0;
llarp_time_t lastGoodSend = 0;
llarp_time_t createdAt;
llarp_time_t sendTimeout = 20 * 1000;
llarp_time_t connectTimeout = 30 * 1000;
llarp_time_t sendTimeout = 40 * 1000;
llarp_time_t connectTimeout = 60 * 1000;
bool markedBad = false;
virtual bool

@ -750,8 +750,6 @@ namespace llarp
if(MarkCurrentIntroBad(llarp_time_now_ms()))
llarp::LogInfo(Name(), " switched intros to ", remoteIntro.router,
" via ", remoteIntro.pathID);
else
UpdateIntroSet();
}
return true;
}
@ -890,7 +888,7 @@ namespace llarp
Endpoint::OutboundContext::OutboundContext(const IntroSet& intro,
Endpoint* parent)
: path::Builder(parent->m_Router, parent->m_Router->dht, 2, 4)
: path::Builder(parent->m_Router, parent->m_Router->dht, 3, 4)
, SendContext(intro.A, {}, this, parent)
, currentIntroSet(intro)
@ -1040,6 +1038,18 @@ namespace llarp
if(now - lastShift < MIN_SHIFT_INTERVAL)
return false;
bool shifted = false;
// to find a intro on the same router as before
for(const auto& intro : currentIntroSet.I)
{
if(intro.ExpiresSoon(now))
continue;
if(m_BadIntros.find(intro) == m_BadIntros.end()
&& remoteIntro.router == intro.router)
{
remoteIntro = intro;
return true;
}
}
for(const auto& intro : currentIntroSet.I)
{
m_Endpoint->EnsureRouterIsKnown(intro.router);
@ -1369,12 +1379,7 @@ namespace llarp
if(remoteIntro.ExpiresSoon(now))
{
// shift intro
if(!MarkCurrentIntroBad(now))
{
UpdateIntroSet();
llarp::LogError("dropping message, no path after shifting intros");
return;
}
MarkCurrentIntroBad(now);
}
auto path = m_PathSet->GetNewestPathByRouter(remoteIntro.router);

Loading…
Cancel
Save