Cap large RTT values

This commit is contained in:
Keith Winstein
2011-08-10 02:45:10 -04:00
parent 1c8b008e89
commit 6ebc686661
+5 -1
View File
@@ -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;