implement sending of shortened packet numbers

This commit is contained in:
Marten Seemann
2016-05-09 23:03:04 +07:00
parent 7609246b45
commit 7169584ff9
11 changed files with 368 additions and 134 deletions

View File

@@ -47,7 +47,7 @@ var _ = Describe("Server", func() {
It("composes version negotiation packets", func() {
expected := append(
[]byte{0x3d, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0},
[]byte{0x01 | 0x08 | 0x04, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0},
protocol.SupportedVersionsAsTags...,
)
Expect(composeVersionNegotiation(1)).To(Equal(expected))
@@ -111,7 +111,7 @@ var _ = Describe("Server", func() {
}
data = data[:n]
expected := append(
[]byte{0x3d, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0},
[]byte{0xd, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0},
protocol.SupportedVersionsAsTags...,
)
Expect(data).To(Equal(expected))