Make sure resends (with new framing) get new state number -- pretty hairy!
This commit is contained in:
@@ -93,10 +93,8 @@ void Transport<MyState, RemoteState>::send_to_receiver( void )
|
|||||||
uint64_t new_num;
|
uint64_t new_num;
|
||||||
if ( current_state == sent_states.back().state ) { /* previously sent */
|
if ( current_state == sent_states.back().state ) { /* previously sent */
|
||||||
new_num = sent_states.back().num;
|
new_num = sent_states.back().num;
|
||||||
fprintf( stderr, "Sending OLD state %d\r\n", (int)new_num );
|
|
||||||
} else { /* new state */
|
} else { /* new state */
|
||||||
new_num = sent_states.back().num + 1;
|
new_num = sent_states.back().num + 1;
|
||||||
fprintf( stderr, "Sending NEW state %d\r\n", (int)new_num );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool done = false;
|
bool done = false;
|
||||||
@@ -116,14 +114,16 @@ void Transport<MyState, RemoteState>::send_to_receiver( void )
|
|||||||
fprintf( stderr, "Caught Path MTU exception, MTU now = %d\n", connection.get_MTU() );
|
fprintf( stderr, "Caught Path MTU exception, MTU now = %d\n", connection.get_MTU() );
|
||||||
done = false;
|
done = false;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if ( current_state == sent_states.back().state ) {
|
if ( new_num == sent_states.back().num ) {
|
||||||
sent_states.back().timestamp = timestamp();
|
sent_states.back().timestamp = timestamp();
|
||||||
} else {
|
} else {
|
||||||
sent_states.push_back( TimestampedState<MyState>( timestamp(), new_num, current_state ) );
|
sent_states.push_back( TimestampedState<MyState>( timestamp(), new_num, current_state ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
new_num++;
|
||||||
|
}
|
||||||
|
|
||||||
/* successfully sent, probably */
|
/* successfully sent, probably */
|
||||||
/* ("probably" because the FIRST size-exceeded datagram doesn't get an error) */
|
/* ("probably" because the FIRST size-exceeded datagram doesn't get an error) */
|
||||||
assumed_receiver_state = sent_states.end();
|
assumed_receiver_state = sent_states.end();
|
||||||
|
|||||||
Reference in New Issue
Block a user