From 6a56487587e22c2fa9206eaf7892beac2252e1f9 Mon Sep 17 00:00:00 2001 From: Keith Winstein Date: Tue, 9 Aug 2011 23:49:06 -0400 Subject: [PATCH] More debuggin --- network.hpp | 2 +- networktransport.cpp | 4 +--- ntester.cpp | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/network.hpp b/network.hpp index 1a1d873..1cbda21 100644 --- a/network.hpp +++ b/network.hpp @@ -76,7 +76,7 @@ namespace Network { void send( string &s ); string recv( void ); int fd( void ) { return sock; } - int get_MTU( void ) { return MTU; } + int get_MTU( void ) { return 110; } int port( void ); string get_key( void ) { return key.printable_key(); } diff --git a/networktransport.cpp b/networktransport.cpp index 446d131..159d17c 100644 --- a/networktransport.cpp +++ b/networktransport.cpp @@ -131,12 +131,10 @@ void Transport::send_to_receiver( void ) /* If this is the final diff in a sequence, make sure it does get the highest state number (even if we've retread to previously-seen ground ) */ /* This will force the client to update to this state */ - /* if ( (previously_sent->num != sent_states.back().num) && (new_state == target_receiver_state) ) { previously_sent = sent_states.end(); } - */ if ( previously_sent == sent_states.end() ) { /* not previously sent */ inst.new_num = sent_states.back().num + 1; @@ -153,7 +151,7 @@ void Transport::send_to_receiver( void ) string s = inst.tostring(); try { - fprintf( stderr, "Sent instruction from %d => %d (terminal %d)\r\n", int(inst.old_num), int(inst.new_num), int(sent_states.back().num) ); + fprintf( stderr, "Sent instruction from %d => %d (terminal %d): %s\r\n", int(inst.old_num), int(inst.new_num), int(sent_states.back().num), inst.diff.c_str() ); connection.send( s ); } catch ( MTUException m ) { continue; diff --git a/ntester.cpp b/ntester.cpp index 78cba42..3ef57de 100644 --- a/ntester.cpp +++ b/ntester.cpp @@ -102,7 +102,7 @@ int main( int argc, char *argv[] ) if ( fds[ 0 ].revents & POLLIN ) { char x = getchar(); - for ( int i = 0; i < 4096; i++ ) { + for ( int i = 0; i < 20; i++ ) { n->get_current_state().key_hit( x ); } }