parse the packet header before getting the session from the session map

This commit is contained in:
Marten Seemann 2017-11-09 20:52:52 +07:00
parent dd722758af
commit 5d4174b2f0
8 changed files with 144 additions and 173 deletions

View file

@ -12,7 +12,7 @@ var _ = Describe("Version Negotiation Packets", func() {
It("writes for gQUIC", func() {
versions := []protocol.VersionNumber{1001, 1003}
data := ComposeGQUICVersionNegotiation(0x1337, versions)
hdr, err := parsePublicHeader(bytes.NewReader(data), protocol.PerspectiveServer, protocol.VersionUnknown)
hdr, err := parsePublicHeader(bytes.NewReader(data), protocol.PerspectiveServer)
Expect(err).ToNot(HaveOccurred())
Expect(hdr.VersionFlag).To(BeTrue())
Expect(hdr.ConnectionID).To(Equal(protocol.ConnectionID(0x1337)))