mirror of
https://github.com/refraction-networking/uquic.git
synced 2025-04-06 21:57:36 +03:00
implement changes to the CONNECTION_CLOSE frame
This commit is contained in:
parent
f82c583957
commit
73ac6b14bf
4 changed files with 103 additions and 37 deletions
|
@ -51,7 +51,7 @@ var _ = Describe("Frame parsing", func() {
|
|||
Expect(frame).To(Equal(f))
|
||||
})
|
||||
|
||||
It("unpacks CONNECTION_CLOSE frames", func() {
|
||||
It("unpacks CONNECTION_CLOSE frames containing QUIC error codes", func() {
|
||||
f := &ConnectionCloseFrame{ReasonPhrase: "foo"}
|
||||
err := f.Write(buf, versionIETFFrames)
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
|
@ -60,6 +60,18 @@ var _ = Describe("Frame parsing", func() {
|
|||
Expect(frame).To(Equal(f))
|
||||
})
|
||||
|
||||
It("unpacks CONNECTION_CLOSE frames containing application error codes", func() {
|
||||
f := &ConnectionCloseFrame{
|
||||
IsApplicationError: true,
|
||||
ReasonPhrase: "foo",
|
||||
}
|
||||
err := f.Write(buf, versionIETFFrames)
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
frame, err := ParseNextFrame(bytes.NewReader(buf.Bytes()), nil, versionIETFFrames)
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
Expect(frame).To(Equal(f))
|
||||
})
|
||||
|
||||
It("unpacks MAX_DATA frames", func() {
|
||||
f := &MaxDataFrame{
|
||||
ByteOffset: 0xcafe,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue