add the APPLICATION_ERROR, use it in CONNECTION_CLOSE frames

This commit is contained in:
Marten Seemann 2020-03-21 10:56:36 +07:00
parent 6d61dccc2f
commit 09e16b7602
4 changed files with 8 additions and 9 deletions

View file

@ -336,7 +336,7 @@ var _ = Describe("Packet packer", func() {
Expect(p.packets[0].frames[0].Frame).To(BeAssignableToTypeOf(&wire.ConnectionCloseFrame{}))
ccf := p.packets[0].frames[0].Frame.(*wire.ConnectionCloseFrame)
Expect(ccf.IsApplicationError).To(BeFalse())
Expect(ccf.ErrorCode).To(Equal(qerr.UserCanceledError.ErrorCode))
Expect(ccf.ErrorCode).To(Equal(qerr.ApplicationError))
Expect(ccf.ReasonPhrase).To(BeEmpty())
Expect(p.packets[1].header.Type).To(Equal(protocol.PacketTypeHandshake))
Expect(p.packets[1].header.PacketNumber).To(Equal(protocol.PacketNumber(2)))
@ -344,7 +344,7 @@ var _ = Describe("Packet packer", func() {
Expect(p.packets[1].frames[0].Frame).To(BeAssignableToTypeOf(&wire.ConnectionCloseFrame{}))
ccf = p.packets[1].frames[0].Frame.(*wire.ConnectionCloseFrame)
Expect(ccf.IsApplicationError).To(BeFalse())
Expect(ccf.ErrorCode).To(Equal(qerr.UserCanceledError.ErrorCode))
Expect(ccf.ErrorCode).To(Equal(qerr.ApplicationError))
Expect(ccf.ReasonPhrase).To(BeEmpty())
Expect(p.packets[2].header.IsLongHeader).To(BeFalse())
Expect(p.packets[2].header.PacketNumber).To(Equal(protocol.PacketNumber(3)))
@ -376,7 +376,7 @@ var _ = Describe("Packet packer", func() {
Expect(p.packets[0].frames[0].Frame).To(BeAssignableToTypeOf(&wire.ConnectionCloseFrame{}))
ccf := p.packets[0].frames[0].Frame.(*wire.ConnectionCloseFrame)
Expect(ccf.IsApplicationError).To(BeFalse())
Expect(ccf.ErrorCode).To(Equal(qerr.UserCanceledError.ErrorCode))
Expect(ccf.ErrorCode).To(Equal(qerr.ApplicationError))
Expect(ccf.ReasonPhrase).To(BeEmpty())
Expect(p.packets[1].header.IsLongHeader).To(BeFalse())
Expect(p.packets[1].header.PacketNumber).To(Equal(protocol.PacketNumber(2)))
@ -408,7 +408,7 @@ var _ = Describe("Packet packer", func() {
Expect(p.packets[0].frames[0].Frame).To(BeAssignableToTypeOf(&wire.ConnectionCloseFrame{}))
ccf := p.packets[0].frames[0].Frame.(*wire.ConnectionCloseFrame)
Expect(ccf.IsApplicationError).To(BeFalse())
Expect(ccf.ErrorCode).To(Equal(qerr.UserCanceledError.ErrorCode))
Expect(ccf.ErrorCode).To(Equal(qerr.ApplicationError))
Expect(ccf.ReasonPhrase).To(BeEmpty())
Expect(p.packets[1].header.Type).To(Equal(protocol.PacketType0RTT))
Expect(p.packets[1].header.PacketNumber).To(Equal(protocol.PacketNumber(2)))