fix splitting of STREAM frames for IETF QUIC

Move splitting of STREAM frames from the quic package to the wire
package.
This commit is contained in:
Marten Seemann 2018-02-05 11:50:36 +08:00
parent 5974c6c113
commit 80969de93f
39 changed files with 248 additions and 157 deletions

View file

@ -345,7 +345,7 @@ var _ = Describe("Packet packer", func() {
It("packs a lot of control frames into 2 packets if they don't fit into one", func() {
blockedFrame := &wire.BlockedFrame{}
maxFramesPerPacket := int(maxFrameSize) / int(blockedFrame.MinLength(packer.version))
maxFramesPerPacket := int(maxFrameSize) / int(blockedFrame.Length(packer.version))
var controlFrames []wire.Frame
for i := 0; i < maxFramesPerPacket+10; i++ {
controlFrames = append(controlFrames, blockedFrame)
@ -445,7 +445,7 @@ var _ = Describe("Packet packer", func() {
StreamID: 5,
DataLenPresent: true,
}
f.Data = bytes.Repeat([]byte{'f'}, int(maxSize-f.MinLength(packer.version)))
f.Data = bytes.Repeat([]byte{'f'}, int(maxSize-f.Length(packer.version)))
return []*wire.StreamFrame{f}
})
mockStreamFramer.EXPECT().PopStreamFrames(gomock.Any())
@ -468,7 +468,7 @@ var _ = Describe("Packet packer", func() {
StreamID: 5,
DataLenPresent: true,
}
f.Data = bytes.Repeat([]byte{'f'}, int(maxSize-f.MinLength(packer.version)))
f.Data = bytes.Repeat([]byte{'f'}, int(maxSize-f.Length(packer.version)))
return []*wire.StreamFrame{f}
})
mockStreamFramer.EXPECT().PopStreamFrames(gomock.Any())