diff --git a/network.cpp b/network.cpp index b054db8..109b09f 100644 --- a/network.cpp +++ b/network.cpp @@ -54,9 +54,11 @@ Packet Connection::new_packet( string &s_payload ) { uint16_t outgoing_timestamp_reply = -1; - if ( timestamp() - saved_timestamp_received_at < 25 ) { - /* we have a recent received timestamp */ - outgoing_timestamp_reply = saved_timestamp; + uint64_t now = timestamp(); + + if ( now - saved_timestamp_received_at < 1000 ) { /* we have a recent received timestamp */ + /* send "corrected" timestamp advanced by how long we held it */ + outgoing_timestamp_reply = saved_timestamp + (now - saved_timestamp_received_at); saved_timestamp = -1; saved_timestamp_received_at = 0; } diff --git a/transportsender.cpp b/transportsender.cpp index 44ec541..e59a486 100644 --- a/transportsender.cpp +++ b/transportsender.cpp @@ -28,7 +28,7 @@ TransportSender::TransportSender( Connection *s_connection, MyState &in template unsigned int TransportSender::send_interval( void ) { - int SEND_INTERVAL = lrint( ceil( (connection->get_SRTT() - ACK_DELAY) / 2.0 ) ); + int SEND_INTERVAL = lrint( ceil( connection->get_SRTT() / 2.0 ) ); if ( SEND_INTERVAL < SEND_INTERVAL_MIN ) { SEND_INTERVAL = SEND_INTERVAL_MIN; } else if ( SEND_INTERVAL > SEND_INTERVAL_MAX ) {