From b29e3e9d398ee84833a8da4548e87bd74fbd6800 Mon Sep 17 00:00:00 2001 From: Keith Winstein Date: Sat, 22 Oct 2011 15:07:03 -0400 Subject: [PATCH] More robust shutdown handling --- transportsender.cpp | 8 ++++---- transportsender.hpp | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/transportsender.cpp b/transportsender.cpp index 5b45d14..def9a61 100644 --- a/transportsender.cpp +++ b/transportsender.cpp @@ -246,10 +246,6 @@ void TransportSender::send_in_fragments( string diff, uint64_t new_num for ( auto i = fragments.begin(); i != fragments.end(); i++ ) { connection->send( i->tostring() ); - if ( new_num == uint64_t(-1) ) { - shutdown_tries++; - } - if ( verbose ) { fprintf( stderr, "[%d] Sent [%d=>%d] id %d, frag %d ack=%d, throwaway=%d, len=%d, frame rate=%.2f, timeout=%d\n", (int)(timestamp() % 100000), (int)inst.old_num(), (int)inst.new_num(), (int)i->id, (int)i->fragment_num, @@ -260,6 +256,10 @@ void TransportSender::send_in_fragments( string diff, uint64_t new_num } + if ( new_num == uint64_t(-1) ) { + shutdown_tries++; + } + pending_data_ack = false; } diff --git a/transportsender.hpp b/transportsender.hpp index fbbd7da..04fdb28 100644 --- a/transportsender.hpp +++ b/transportsender.hpp @@ -19,7 +19,7 @@ namespace Network { { private: /* timing parameters */ - static const int SEND_INTERVAL_MIN = 25; /* ms between frames */ + static const int SEND_INTERVAL_MIN = 20; /* ms between frames */ static const int SEND_INTERVAL_MAX = 250; /* ms between frames */ static const int ACK_INTERVAL = 3000; /* ms between empty acks */ static const int ACK_DELAY = 20; /* ms before delayed ack */