mirror of
https://github.com/refraction-networking/uquic.git
synced 2025-04-03 20:27:35 +03:00
send a reserved version number in version negotiation packets
This commit is contained in:
parent
1f5cd31569
commit
be29963637
6 changed files with 43 additions and 16 deletions
|
@ -16,7 +16,11 @@ var _ = Describe("Version Negotiation Packets", func() {
|
|||
Expect(err).ToNot(HaveOccurred())
|
||||
Expect(hdr.VersionFlag).To(BeTrue())
|
||||
Expect(hdr.ConnectionID).To(Equal(protocol.ConnectionID(0x1337)))
|
||||
Expect(hdr.SupportedVersions).To(Equal(versions))
|
||||
// the supported versions should include one reserved version number
|
||||
Expect(hdr.SupportedVersions).To(HaveLen(len(versions) + 1))
|
||||
for _, version := range versions {
|
||||
Expect(hdr.SupportedVersions).To(ContainElement(version))
|
||||
}
|
||||
})
|
||||
|
||||
It("writes in IETF draft style", func() {
|
||||
|
@ -27,6 +31,11 @@ var _ = Describe("Version Negotiation Packets", func() {
|
|||
Expect(hdr.IsVersionNegotiation).To(BeTrue())
|
||||
Expect(hdr.ConnectionID).To(Equal(protocol.ConnectionID(0x1337)))
|
||||
Expect(hdr.PacketNumber).To(Equal(protocol.PacketNumber(0x42)))
|
||||
Expect(hdr.SupportedVersions).To(Equal(versions))
|
||||
Expect(hdr.Version).To(BeZero())
|
||||
// the supported versions should include one reserved version number
|
||||
Expect(hdr.SupportedVersions).To(HaveLen(len(versions) + 1))
|
||||
for _, version := range versions {
|
||||
Expect(hdr.SupportedVersions).To(ContainElement(version))
|
||||
}
|
||||
})
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue