Some debugging
This commit is contained in:
@@ -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++;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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 );
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user