Revert "tweak timeout parameters for link layer."

This reverts commit eef192b37aec070d624e84cedfc94f522fd0a346.
pull/1576/head
Jeff Becker 3 years ago
parent 1677ed40f6
commit e058b873b6
No known key found for this signature in database
GPG Key ID: F357B3B42F6F9B05

@ -97,10 +97,10 @@ namespace llarp
}
bool
OutboundMessage::IsTimedOut(const llarp_time_t now, llarp_time_t timeout) const
OutboundMessage::IsTimedOut(const llarp_time_t now) const
{
// TODO: make configurable by outbound message deliverer
return now > m_StartedAt && now - m_StartedAt > timeout;
return now > m_StartedAt && now - m_StartedAt > DeliveryTimeout;
}
void
@ -166,9 +166,9 @@ namespace llarp
}
bool
InboundMessage::IsTimedOut(const llarp_time_t now, llarp_time_t timeout) const
InboundMessage::IsTimedOut(const llarp_time_t now) const
{
return now > m_LastActiveAt && now - m_LastActiveAt > timeout;
return now > m_LastActiveAt && now - m_LastActiveAt > DeliveryTimeout;
}
void

@ -69,7 +69,7 @@ namespace llarp
IsTransmitted() const;
bool
IsTimedOut(llarp_time_t now, llarp_time_t timeout) const;
IsTimedOut(llarp_time_t now) const;
void
InformTimeout();
@ -94,7 +94,7 @@ namespace llarp
IsCompleted() const;
bool
IsTimedOut(llarp_time_t now, llarp_time_t timeout) const;
IsTimedOut(llarp_time_t now) const;
bool
Verify() const;

@ -363,7 +363,7 @@ namespace llarp
auto itr = m_TXMsgs.begin();
while (itr != m_TXMsgs.end())
{
if (itr->second.IsTimedOut(now, DeliveryTimeout()))
if (itr->second.IsTimedOut(now))
{
m_Stats.totalDroppedTX++;
m_Stats.totalInFlightTX--;
@ -380,7 +380,7 @@ namespace llarp
auto itr = m_RXMsgs.begin();
while (itr != m_RXMsgs.end())
{
if (itr->second.IsTimedOut(now, ReceivalTimeout))
if (itr->second.IsTimedOut(now))
{
m_ReplayFilter.emplace(itr->first, now);
itr = m_RXMsgs.erase(itr);
@ -407,17 +407,6 @@ namespace llarp
using Introduction =
AlignedBuffer<PubKey::SIZE + PubKey::SIZE + TunnelNonce::SIZE + Signature::SIZE>;
Session::Time_t
Session::DeliveryTimeout() const
{
if (m_Inbound and not m_RemoteRC.IsPublicRouter())
return ClientDeliveryTimeout;
if (m_Parent->GetOurRC().IsPublicRouter())
return SNodeDeliveryTimeout;
else
return ClientDeliveryTimeout;
}
void
Session::GenerateAndSendIntro()
{

@ -21,18 +21,16 @@ namespace llarp
/// creates a packet with plaintext size + wire overhead + random pad
ILinkSession::Packet_t
CreatePacket(Command cmd, size_t plainsize, size_t min_pad = 16, size_t pad_variance = 16);
/// Time how long we try delivery for as a snode to snode
static constexpr std::chrono::milliseconds SNodeDeliveryTimeout = 200ms;
/// Time how long we try delivery for to/from a client
static constexpr std::chrono::milliseconds ClientDeliveryTimeout = 500ms;
/// Time how long we try delivery for
static constexpr std::chrono::milliseconds DeliveryTimeout = 500ms;
/// Time how long we wait to recieve a message
static constexpr auto ReceivalTimeout = 1s;
static constexpr auto ReceivalTimeout = (DeliveryTimeout * 8) / 5;
/// How long to keep a replay window for
static constexpr auto ReplayWindow = 1500ms;
static constexpr auto ReplayWindow = (ReceivalTimeout * 3) / 2;
/// How often to acks RX messages
static constexpr auto ACKResendInterval = 200ms;
static constexpr auto ACKResendInterval = DeliveryTimeout / 2;
/// How often to retransmit TX fragments
static constexpr auto TXFlushInterval = 200ms;
static constexpr auto TXFlushInterval = (DeliveryTimeout / 5) * 4;
/// How often we send a keepalive
static constexpr std::chrono::milliseconds PingInterval = 5s;
/// How long we wait for a session to die with no tx from them
@ -55,9 +53,6 @@ namespace llarp
void
Pump() override;
Time_t
DeliveryTimeout() const;
void
Tick(llarp_time_t now) override;

Loading…
Cancel
Save