DefaultPathAlignmentTimeout -> PathAlignmentTimeout

pull/1634/head
Jeff Becker 3 years ago
parent c834414b47
commit c5350ab2c4
No known key found for this signature in database
GPG Key ID: F357B3B42F6F9B05

@ -131,8 +131,6 @@ namespace llarp
m_Resolver->Restart(); m_Resolver->Restart();
} }
constexpr auto DefaultAlignmentTimeout = 15s;
bool bool
TunEndpoint::Configure(const NetworkConfig& conf, const DnsConfig& dnsConf) TunEndpoint::Configure(const NetworkConfig& conf, const DnsConfig& dnsConf)
{ {
@ -174,7 +172,7 @@ namespace llarp
m_PathAlignmentTimeout = *conf.m_PathAlignmentTimeout; m_PathAlignmentTimeout = *conf.m_PathAlignmentTimeout;
} }
else else
m_PathAlignmentTimeout = DefaultAlignmentTimeout; m_PathAlignmentTimeout = service::Endpoint::PathAlignmentTimeout();
for (const auto& item : conf.m_mapAddrs) for (const auto& item : conf.m_mapAddrs)
{ {
@ -279,7 +277,7 @@ namespace llarp
SendDNSReply(snode, s, msg, reply, isV6); 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 { service::Address addr, auto msg, bool isV6) -> bool {
using service::Address; using service::Address;
using service::OutboundContext; 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 { service::Address addr, auto msg) -> bool {
using service::Address; using service::Address;
using service::OutboundContext; using service::OutboundContext;
@ -932,7 +930,7 @@ namespace llarp
} }
self->SendToOrQueue(addr, pkt.ConstBuffer(), service::ProtocolType::Exit); self->SendToOrQueue(addr, pkt.ConstBuffer(), service::ProtocolType::Exit);
}, },
m_PathAlignmentTimeout); PathAlignmentTimeout());
return; return;
} }
bool rewriteAddrs = true; bool rewriteAddrs = true;

@ -136,7 +136,7 @@ namespace llarp
} }
llarp_time_t llarp_time_t
DefaultPathAlignmentTimeout() const override PathAlignmentTimeout() const override
{ {
return m_PathAlignmentTimeout; return m_PathAlignmentTimeout;
} }

@ -1850,7 +1850,7 @@ namespace llarp
} }
self->m_state->m_PendingTraffic.erase(addr); self->m_state->m_PendingTraffic.erase(addr);
}, },
DefaultPathAlignmentTimeout()); PathAlignmentTimeout());
return true; return true;
} }
LogDebug("SendOrQueue failed: no inbound/outbound sessions"); LogDebug("SendOrQueue failed: no inbound/outbound sessions");

@ -307,9 +307,10 @@ namespace llarp
ShouldBuildMore(llarp_time_t now) const override; ShouldBuildMore(llarp_time_t now) const override;
virtual llarp_time_t virtual llarp_time_t
DefaultPathAlignmentTimeout() const PathAlignmentTimeout() const
{ {
return 10s; constexpr auto DefaultPathAlignmentTimeout = 30s;
return DefaultPathAlignmentTimeout;
} }
bool bool

Loading…
Cancel
Save