From 30fc11403d020115f4a9a31e88300e5964fbb0ec Mon Sep 17 00:00:00 2001 From: Keith Winstein Date: Fri, 12 Aug 2011 05:34:49 -0400 Subject: [PATCH] Some debugging --- keystroke.cpp | 4 ++++ networktransport.cpp | 6 ++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/keystroke.cpp b/keystroke.cpp index 687cfca..e2f4556 100644 --- a/keystroke.cpp +++ b/keystroke.cpp @@ -22,6 +22,10 @@ string KeyStroke::diff_from( KeyStroke const & existing ) i != existing.user_bytes.end(); i++ ) { assert( my_it != user_bytes.end() ); + if ( *i != *my_it ) { + fprintf( stderr, "BUG: existing state has %c and new state has %c\n", + *i, *my_it ); + } assert( *i == *my_it ); my_it++; } diff --git a/networktransport.cpp b/networktransport.cpp index 47a81b8..ae4d60e 100644 --- a/networktransport.cpp +++ b/networktransport.cpp @@ -146,6 +146,8 @@ void Transport::update_assumed_receiver_state( void ) if ( int(now - i->timestamp) < connection.timeout() ) { assumed_receiver_state = i; + } else { + return; } } } @@ -302,8 +304,8 @@ void Transport::send_in_fragments( string diff, uint64_t n this_fragment ); string s = inst.tostring(); - fprintf( stderr, "Sending [%d=>%d], len=%u\n", - (int)inst.old_num, (int)inst.new_num, (unsigned int)inst.diff.size() ); + fprintf( stderr, "Sending [%d=>%d frag %d], len=%u\r\n", + (int)inst.old_num, (int)inst.new_num, inst.fragment_num, (unsigned int)inst.diff.size() ); connection.send( s ); }