@@ -578,7 +578,7 @@ u16 Channel::getOutgoingSequenceNumber(bool& successful)
578
578
// ugly cast but this one is required in order to tell compiler we
579
579
// know about difference of two unsigned may be negative in general
580
580
// but we already made sure it won't happen in this case
581
- if (((u16)(next_outgoing_seqnum - lowest_unacked_seqnumber)) > window_size ) {
581
+ if (((u16)(next_outgoing_seqnum - lowest_unacked_seqnumber)) > m_window_size ) {
582
582
successful = false ;
583
583
return 0 ;
584
584
}
@@ -588,7 +588,7 @@ u16 Channel::getOutgoingSequenceNumber(bool& successful)
588
588
// know about difference of two unsigned may be negative in general
589
589
// but we already made sure it won't happen in this case
590
590
if ((next_outgoing_seqnum + (u16)(SEQNUM_MAX - lowest_unacked_seqnumber)) >
591
- window_size ) {
591
+ m_window_size ) {
592
592
successful = false ;
593
593
return 0 ;
594
594
}
@@ -666,7 +666,7 @@ void Channel::UpdateTimers(float dtime)
666
666
// packet_too_late = current_packet_too_late;
667
667
packets_successful = current_packet_successful;
668
668
669
- if (current_bytes_transfered > (unsigned int ) (window_size *512 /2 )) {
669
+ if (current_bytes_transfered > (unsigned int ) (m_window_size *512 /2 )) {
670
670
reasonable_amount_of_data_transmitted = true ;
671
671
}
672
672
current_packet_loss = 0 ;
@@ -681,37 +681,25 @@ void Channel::UpdateTimers(float dtime)
681
681
if (packets_successful > 0 ) {
682
682
successful_to_lost_ratio = packet_loss/packets_successful;
683
683
} else if (packet_loss > 0 ) {
684
- window_size = std::max (
685
- (window_size - 10 ),
686
- MIN_RELIABLE_WINDOW_SIZE);
684
+ setWindowSize (m_window_size - 10 );
687
685
done = true ;
688
686
}
689
687
690
688
if (!done) {
691
- if ((successful_to_lost_ratio < 0 .01f ) &&
692
- (window_size < MAX_RELIABLE_WINDOW_SIZE)) {
689
+ if (successful_to_lost_ratio < 0 .01f ) {
693
690
/* don't even think about increasing if we didn't even
694
691
* use major parts of our window */
695
692
if (reasonable_amount_of_data_transmitted)
696
- window_size = std::min (
697
- (window_size + 100 ),
698
- MAX_RELIABLE_WINDOW_SIZE);
699
- } else if ((successful_to_lost_ratio < 0 .05f ) &&
700
- (window_size < MAX_RELIABLE_WINDOW_SIZE)) {
693
+ setWindowSize (m_window_size + 100 );
694
+ } else if (successful_to_lost_ratio < 0 .05f ) {
701
695
/* don't even think about increasing if we didn't even
702
696
* use major parts of our window */
703
697
if (reasonable_amount_of_data_transmitted)
704
- window_size = std::min (
705
- (window_size + 50 ),
706
- MAX_RELIABLE_WINDOW_SIZE);
698
+ setWindowSize (m_window_size + 50 );
707
699
} else if (successful_to_lost_ratio > 0 .15f ) {
708
- window_size = std::max (
709
- (window_size - 100 ),
710
- MIN_RELIABLE_WINDOW_SIZE);
700
+ setWindowSize (m_window_size - 100 );
711
701
} else if (successful_to_lost_ratio > 0 .1f ) {
712
- window_size = std::max (
713
- (window_size - 50 ),
714
- MIN_RELIABLE_WINDOW_SIZE);
702
+ setWindowSize (m_window_size - 50 );
715
703
}
716
704
}
717
705
}
0 commit comments