send a StopWaiting with every ACK in QUIC 34

fixes #185
This commit is contained in:
Marten Seemann
2016-07-29 18:00:05 +07:00
parent 73a64fde5f
commit 7604f7927d
7 changed files with 40 additions and 3 deletions

View File

@@ -272,6 +272,16 @@ func (h *sentPacketHandler) GetLargestAcked() protocol.PacketNumber {
return h.LargestAcked
}
func (h *sentPacketHandler) GetStopWaitingFrame() *frames.StopWaitingFrame {
if h.LargestAcked == 0 {
return nil
}
return &frames.StopWaitingFrame{
LeastUnacked: h.LargestAcked + 1,
}
}
func (h *sentPacketHandler) CongestionAllowsSending() bool {
return h.BytesInFlight() <= h.congestion.GetCongestionWindow()
}