mirror of https://github.com/Desuuuu/klipper.git
serialqueue: Fix off-by-one error in retransmit sequence number tracking
Commit 4655a6bf
allowed naks to be honored if receive_seq was greater
than the last retransmitted sequence. However, receive_seq is the
receiver's next sequence number, so a nak should only be processed if
it is one greater than that.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
parent
7d17002b33
commit
91b9634198
|
@ -609,9 +609,9 @@ retransmit_event(struct serialqueue *sq, double eventtime)
|
|||
sq->rto *= 2.0;
|
||||
if (sq->rto > MAX_RTO)
|
||||
sq->rto = MAX_RTO;
|
||||
sq->ignore_nak_seq = sq->send_seq - 1;
|
||||
sq->ignore_nak_seq = sq->send_seq;
|
||||
}
|
||||
sq->retransmit_seq = sq->send_seq - 1;
|
||||
sq->retransmit_seq = sq->send_seq;
|
||||
sq->rtt_sample_seq = 0;
|
||||
sq->idle_time = eventtime + buflen * sq->baud_adjust;
|
||||
double waketime = eventtime + first_buflen * sq->baud_adjust + sq->rto;
|
||||
|
|
Loading…
Reference in New Issue