Some debugging

This commit is contained in:
Keith Winstein
2011-08-12 05:34:49 -04:00
parent 17804b2230
commit 30fc11403d
2 changed files with 8 additions and 2 deletions
+4
View File
@@ -22,6 +22,10 @@ string KeyStroke::diff_from( KeyStroke const & existing )
i != existing.user_bytes.end(); i != existing.user_bytes.end();
i++ ) { i++ ) {
assert( my_it != user_bytes.end() ); 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 ); assert( *i == *my_it );
my_it++; my_it++;
} }
+4 -2
View File
@@ -146,6 +146,8 @@ void Transport<MyState, RemoteState>::update_assumed_receiver_state( void )
if ( int(now - i->timestamp) < connection.timeout() ) { if ( int(now - i->timestamp) < connection.timeout() ) {
assumed_receiver_state = i; assumed_receiver_state = i;
} else {
return;
} }
} }
} }
@@ -302,8 +304,8 @@ void Transport<MyState, RemoteState>::send_in_fragments( string diff, uint64_t n
this_fragment ); this_fragment );
string s = inst.tostring(); string s = inst.tostring();
fprintf( stderr, "Sending [%d=>%d], len=%u\n", fprintf( stderr, "Sending [%d=>%d frag %d], len=%u\r\n",
(int)inst.old_num, (int)inst.new_num, (unsigned int)inst.diff.size() ); (int)inst.old_num, (int)inst.new_num, inst.fragment_num, (unsigned int)inst.diff.size() );
connection.send( s ); connection.send( s );
} }