pack QUIC 34 packets with the correct maximum size

fixes #187
This commit is contained in:
Marten Seemann
2016-06-23 18:23:34 +07:00
parent 5e890a8f61
commit ab1db83134
3 changed files with 21 additions and 1 deletions

View File

@@ -181,6 +181,11 @@ func (p *packetPacker) composeNextPacket(stopWaitingFrame *frames.StopWaitingFra
maxFrameSize := protocol.MaxFrameAndPublicHeaderSize - publicHeaderLength
// until QUIC 33, packets have a 1 byte private header
if p.version < protocol.Version34 {
maxFrameSize--
}
if stopWaitingFrame != nil {
payloadFrames = append(payloadFrames, stopWaitingFrame)
minLength, err := stopWaitingFrame.MinLength(p.version)