serialqueue: Don't retransmit on a NAK if no sent data is pending

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor 2017-03-23 00:19:28 -04:00
parent 8d92c898ee
commit 3cafcc2bc7
1 changed files with 2 additions and 1 deletions

View File

@ -487,7 +487,8 @@ handle_message(struct serialqueue *sq, double eventtime, int len)
if (rseq != sq->receive_seq)
// New sequence number
update_receive_seq(sq, eventtime, rseq);
else if (len == MESSAGE_MIN && rseq > sq->retransmit_seq)
else if (len == MESSAGE_MIN && rseq > sq->retransmit_seq
&& !list_empty(&sq->sent_queue))
// Duplicate sequence number in an empty message is a nak
pollreactor_update_timer(&sq->pr, SQPT_RETRANSMIT, PR_NOW);