forked from quic-go/quic-go
remove the error return value from wire.Frame.MinLength
No functional change expected. The error was only non-nil if some required values for the STOP_WAITING frame were not set. It should be sufficient to throw an error when attempting to write an invalid STOP_WAITING frame.
This commit is contained in:
@@ -49,14 +49,8 @@ func (f *StopWaitingFrame) Write(b *bytes.Buffer, _ protocol.VersionNumber) erro
|
||||
}
|
||||
|
||||
// MinLength of a written frame
|
||||
func (f *StopWaitingFrame) MinLength(_ protocol.VersionNumber) (protocol.ByteCount, error) {
|
||||
minLength := protocol.ByteCount(1) // typeByte
|
||||
|
||||
if f.PacketNumberLen == protocol.PacketNumberLenInvalid {
|
||||
return 0, errPacketNumberLenNotSet
|
||||
}
|
||||
minLength += protocol.ByteCount(f.PacketNumberLen)
|
||||
return minLength, nil
|
||||
func (f *StopWaitingFrame) MinLength(_ protocol.VersionNumber) protocol.ByteCount {
|
||||
return 1 + protocol.ByteCount(f.PacketNumberLen)
|
||||
}
|
||||
|
||||
// ParseStopWaitingFrame parses a StopWaiting frame
|
||||
|
||||
Reference in New Issue
Block a user