set LeastUnackedDelta length in StopWaitingFrame

fixes #79
This commit is contained in:
Marten Seemann
2016-05-12 13:05:42 +07:00
parent aaf4b0ae9e
commit 33c0f3a5df
15 changed files with 187 additions and 51 deletions

View File

@@ -94,14 +94,14 @@ func (f *AckFrame) Write(b *bytes.Buffer, packetNumber protocol.PacketNumber, ve
}
// MinLength of a written frame
func (f *AckFrame) MinLength() protocol.ByteCount {
func (f *AckFrame) MinLength() (protocol.ByteCount, error) {
l := 1 + 1 + 6 + 2 + 1 + 1 + 4
l += (1 + 2) * 0 /* TODO: num_timestamps */
if f.HasNACK() {
l += 1 + (6+1)*len(f.NackRanges)
l++ // TODO: Remove once we drop support for <32
}
return protocol.ByteCount(l)
return protocol.ByteCount(l), nil
}
// HasNACK returns if the frame has NACK ranges