Don't send -1 ack packets

This commit is contained in:
QuantumEntangledAndy committed 2023-08-04 18:59:14 +07:00
1 parent 810dd3cdc7
commit 6b60ee6bcc
1 file changed
+1 -1
@@ -282,7 +282,7 @@ impl UdpPayloadSource {
self.send_buffer.push_back(BcUdp::Data(resend.clone()));
}
}
if self.ack_interval.poll_tick(cx).is_ready() {
if self.ack_interval.poll_tick(cx).is_ready() && self.packets_want > 0 {
let ack = BcUdp::Ack(self.build_send_ack());
self.send_buffer.push_back(ack);
self.state = State::Flushing;