Remove synthetic packet loss

This commit is contained in:
Keith Winstein
2011-08-10 02:20:31 -04:00
parent 3d5942b3d4
commit fa2b29813a
+2 -2
View File
@@ -161,9 +161,11 @@ void Connection::send( string &s, bool send_timestamp )
string p = px.tostring( &session );
/* XXX synthetic packet loss */
/*
if ( rand() < RAND_MAX / 2 ) {
return;
}
*/
ssize_t bytes_sent = sendto( sock, p.data(), p.size(), 0,
(sockaddr *)&remote_addr, sizeof( remote_addr ) );
@@ -210,8 +212,6 @@ string Connection::recv( void )
assert( now >= p.timestamp_reply );
const double R = now - p.timestamp_reply;
fprintf( stderr, "Saw delay of %f\r\n", R );
if ( !RTT_hit ) { /* first measurement */
SRTT = R;
RTTVAR = R / 2;