From 63b9bcb20084a4dc1643d675062e6f56570f9712 Mon Sep 17 00:00:00 2001 From: Keith Winstein Date: Tue, 9 Aug 2011 23:41:55 -0400 Subject: [PATCH] Fix bug causing new state numbers when not necessary --- networktransport.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/networktransport.cpp b/networktransport.cpp index 03f4ee3..696fbb0 100644 --- a/networktransport.cpp +++ b/networktransport.cpp @@ -131,9 +131,7 @@ 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 */ - typename list< TimestampedState >::iterator last = sent_states.end(); - last--; - if ( (previously_sent != last) + if ( (previously_sent->num != sent_states.back().num) && (new_state == target_receiver_state) ) { previously_sent = sent_states.end(); } @@ -153,6 +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) ); connection.send( s ); } catch ( MTUException m ) { continue;