From 823dc588917203265cdcb32eb6cb84145dcdb13a Mon Sep 17 00:00:00 2001 From: Keith Winstein Date: Tue, 13 Sep 2011 01:02:22 -0400 Subject: [PATCH] Max RTO of 1 s --- network.cpp | 2 ++ network.hpp | 1 + 2 files changed, 3 insertions(+) diff --git a/network.cpp b/network.cpp index 45ac224..2d93d82 100644 --- a/network.cpp +++ b/network.cpp @@ -312,6 +312,8 @@ uint64_t Connection::timeout( void ) uint64_t RTO = lrint( ceil( SRTT + 4 * RTTVAR ) ); if ( RTO < MIN_RTO ) { RTO = MIN_RTO; + } else if ( RTO > MAX_RTO ) { + RTO = MAX_RTO; } return RTO; } diff --git a/network.hpp b/network.hpp index 5ca7d57..3749ae1 100644 --- a/network.hpp +++ b/network.hpp @@ -58,6 +58,7 @@ namespace Network { private: static const int RECEIVE_MTU = 2048; static const uint64_t MIN_RTO = 50; /* ms */ + static const uint64_t MAX_RTO = 1000; /* ms */ int sock; struct sockaddr_in remote_addr;