From 6ebc6866616d6b95ccdc15068fc40130e58077a8 Mon Sep 17 00:00:00 2001 From: Keith Winstein Date: Wed, 10 Aug 2011 02:45:10 -0400 Subject: [PATCH] Cap large RTT values --- network.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/network.cpp b/network.cpp index b11b489..b1b4406 100644 --- a/network.cpp +++ b/network.cpp @@ -208,7 +208,11 @@ string Connection::recv( void ) if ( p.timestamp_reply != uint64_t(-1) ) { uint64_t now = timestamp(); assert( now >= p.timestamp_reply ); - const double R = now - p.timestamp_reply; + double R = now - p.timestamp_reply; + + if ( R > 5000 ) { /* cap large values, e.g. server was Ctrl-Zed */ + R = 5000; + } if ( !RTT_hit ) { /* first measurement */ SRTT = R;