reverse the order of the SupportedVersions slice

For the client, the Versions option in the quic.Config encodes the first
entry is the preferred version. If not set, this should default to the
highest supported version.
This commit is contained in:
Marten Seemann
2017-04-29 20:13:23 +07:00
parent b305cd674f
commit 9db23eceed
4 changed files with 12 additions and 12 deletions

View File

@@ -264,7 +264,7 @@ var _ = Describe("Server", func() {
Expect(serv.sessions[connID].(*mockSession).packetCount).To(Equal(1))
b := &bytes.Buffer{}
// add an unsupported version
utils.WriteUint32(b, protocol.VersionNumberToTag(protocol.SupportedVersions[0]-2))
utils.WriteUint32(b, protocol.VersionNumberToTag(protocol.SupportedVersions[0]+1))
data := []byte{0x09, 0xf6, 0x19, 0x86, 0x66, 0x9b, 0x9f, 0xfa, 0x4c}
data = append(append(data, b.Bytes()...), 0x01)
err = serv.handlePacket(nil, nil, data)