mirror of
https://github.com/oxen-io/lokinet
synced 2023-12-14 06:53:00 +01:00
Merge pull request #1634 from majestrate/reestablish-session-timeout-fix-2021-05-08
increase session reestablish timeout
This commit is contained in:
commit
696c6d1b5a
|
@ -131,8 +131,6 @@ namespace llarp
|
|||
m_Resolver->Restart();
|
||||
}
|
||||
|
||||
constexpr auto DefaultAlignmentTimeout = 15s;
|
||||
|
||||
bool
|
||||
TunEndpoint::Configure(const NetworkConfig& conf, const DnsConfig& dnsConf)
|
||||
{
|
||||
|
@ -174,7 +172,7 @@ namespace llarp
|
|||
m_PathAlignmentTimeout = *conf.m_PathAlignmentTimeout;
|
||||
}
|
||||
else
|
||||
m_PathAlignmentTimeout = DefaultAlignmentTimeout;
|
||||
m_PathAlignmentTimeout = service::Endpoint::PathAlignmentTimeout();
|
||||
|
||||
for (const auto& item : conf.m_mapAddrs)
|
||||
{
|
||||
|
@ -279,7 +277,7 @@ namespace llarp
|
|||
SendDNSReply(snode, s, msg, reply, isV6);
|
||||
});
|
||||
};
|
||||
auto ReplyToLokiDNSWhenReady = [this, reply, timeout = m_PathAlignmentTimeout](
|
||||
auto ReplyToLokiDNSWhenReady = [this, reply, timeout = PathAlignmentTimeout()](
|
||||
service::Address addr, auto msg, bool isV6) -> bool {
|
||||
using service::Address;
|
||||
using service::OutboundContext;
|
||||
|
@ -305,7 +303,7 @@ namespace llarp
|
|||
}
|
||||
};
|
||||
|
||||
auto ReplyToLokiSRVWhenReady = [this, reply, timeout = m_PathAlignmentTimeout](
|
||||
auto ReplyToLokiSRVWhenReady = [this, reply, timeout = PathAlignmentTimeout()](
|
||||
service::Address addr, auto msg) -> bool {
|
||||
using service::Address;
|
||||
using service::OutboundContext;
|
||||
|
@ -932,7 +930,7 @@ namespace llarp
|
|||
}
|
||||
self->SendToOrQueue(addr, pkt.ConstBuffer(), service::ProtocolType::Exit);
|
||||
},
|
||||
m_PathAlignmentTimeout);
|
||||
PathAlignmentTimeout());
|
||||
return;
|
||||
}
|
||||
bool rewriteAddrs = true;
|
||||
|
|
|
@ -135,6 +135,12 @@ namespace llarp
|
|||
return m_OwnedRanges;
|
||||
}
|
||||
|
||||
llarp_time_t
|
||||
PathAlignmentTimeout() const override
|
||||
{
|
||||
return m_PathAlignmentTimeout;
|
||||
}
|
||||
|
||||
/// ip packet against any exit policies we have
|
||||
/// returns false if this traffic is disallowed by any of those policies
|
||||
/// returns true otherwise
|
||||
|
|
|
@ -1850,7 +1850,7 @@ namespace llarp
|
|||
}
|
||||
self->m_state->m_PendingTraffic.erase(addr);
|
||||
},
|
||||
1500ms);
|
||||
PathAlignmentTimeout());
|
||||
return true;
|
||||
}
|
||||
LogDebug("SendOrQueue failed: no inbound/outbound sessions");
|
||||
|
|
|
@ -306,6 +306,13 @@ namespace llarp
|
|||
bool
|
||||
ShouldBuildMore(llarp_time_t now) const override;
|
||||
|
||||
virtual llarp_time_t
|
||||
PathAlignmentTimeout() const
|
||||
{
|
||||
constexpr auto DefaultPathAlignmentTimeout = 30s;
|
||||
return DefaultPathAlignmentTimeout;
|
||||
}
|
||||
|
||||
bool
|
||||
EnsurePathTo(
|
||||
std::variant<Address, RouterID> addr,
|
||||
|
|
Loading…
Reference in a new issue