mirror of
https://github.com/refraction-networking/uquic.git
synced 2025-04-03 20:27:35 +03:00
implement parsing and writing of MAX_STREAM_ID frames
This commit is contained in:
parent
32168928d1
commit
5afe35328a
4 changed files with 105 additions and 1 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue