implement parsing and writing of MAX_STREAM_ID frames

This commit is contained in:
Marten Seemann 2017-11-03 10:58:35 +07:00
parent 32168928d1
commit 5afe35328a
4 changed files with 105 additions and 1 deletions

View file

@ -342,6 +342,17 @@ var _ = Describe("Packet unpacker", func() {
Expect(packet.frames).To(Equal([]wire.Frame{f}))
})
It("unpacks MAX_STREAM_ID frames", func() {
f := &wire.MaxStreamIDFrame{StreamID: 0x1337}
buf := &bytes.Buffer{}
err := f.Write(buf, versionIETFFrames)
Expect(err).ToNot(HaveOccurred())
setData(buf.Bytes())
packet, err := unpacker.Unpack(hdrBin, hdr, data)
Expect(err).ToNot(HaveOccurred())
Expect(packet.frames).To(Equal([]wire.Frame{f}))
})
It("unpacks connection-level BLOCKED frames", func() {
f := &wire.BlockedFrame{Offset: 0x1234}
buf := &bytes.Buffer{}
@ -406,6 +417,7 @@ var _ = Describe("Packet unpacker", func() {
0x02: qerr.InvalidConnectionCloseData,
0x04: qerr.InvalidWindowUpdateData,
0x05: qerr.InvalidWindowUpdateData,
0x06: qerr.InvalidFrameData,
0x08: qerr.InvalidBlockedData,
0x09: qerr.InvalidBlockedData,
0x0c: qerr.InvalidFrameData,