forked from quic-go/quic-go
add version constants for draft-29 and draft-32
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
[](https://ci.appveyor.com/project/lucas-clemente/quic-go/branch/master)
|
||||
[](https://codecov.io/gh/lucas-clemente/quic-go/)
|
||||
|
||||
quic-go is an implementation of the [QUIC](https://en.wikipedia.org/wiki/QUIC) protocol in Go. It implements the [IETF QUIC draft-29](https://tools.ietf.org/html/draft-ietf-quic-transport-29).
|
||||
quic-go is an implementation of the [QUIC](https://en.wikipedia.org/wiki/QUIC) protocol in Go. It implements the [IETF QUIC draft-29](https://tools.ietf.org/html/draft-ietf-quic-transport-29) and [draft-32](https://tools.ietf.org/html/draft-ietf-quic-transport-32).
|
||||
|
||||
## Version compatibility
|
||||
|
||||
|
||||
@@ -21,6 +21,8 @@ const (
|
||||
VersionTLS VersionNumber = 0x51474fff
|
||||
VersionWhatever VersionNumber = 1 // for when the version doesn't matter
|
||||
VersionUnknown VersionNumber = math.MaxUint32
|
||||
VersionDraft29 VersionNumber = 0xff00001d
|
||||
VersionDraft32 VersionNumber = 0xff000020
|
||||
)
|
||||
|
||||
// SupportedVersions lists the versions that the server supports
|
||||
@@ -38,6 +40,10 @@ func (vn VersionNumber) String() string {
|
||||
return "whatever"
|
||||
case VersionUnknown:
|
||||
return "unknown"
|
||||
case VersionDraft29:
|
||||
return "draft-29"
|
||||
case VersionDraft32:
|
||||
return "draft-32"
|
||||
case VersionTLS:
|
||||
return "TLS dev version (WIP)"
|
||||
default:
|
||||
|
||||
@@ -14,6 +14,8 @@ var _ = Describe("Version", func() {
|
||||
Expect(IsValidVersion(VersionTLS)).To(BeTrue())
|
||||
Expect(IsValidVersion(VersionWhatever)).To(BeFalse())
|
||||
Expect(IsValidVersion(VersionUnknown)).To(BeFalse())
|
||||
Expect(IsValidVersion(VersionDraft29)).To(BeFalse())
|
||||
Expect(IsValidVersion(VersionDraft32)).To(BeFalse())
|
||||
Expect(IsValidVersion(1234)).To(BeFalse())
|
||||
})
|
||||
|
||||
@@ -25,6 +27,8 @@ var _ = Describe("Version", func() {
|
||||
Expect(VersionTLS.String()).To(ContainSubstring("TLS"))
|
||||
Expect(VersionWhatever.String()).To(Equal("whatever"))
|
||||
Expect(VersionUnknown.String()).To(Equal("unknown"))
|
||||
Expect(VersionDraft29.String()).To(Equal("draft-29"))
|
||||
Expect(VersionDraft32.String()).To(Equal("draft-32"))
|
||||
// check with unsupported version numbers from the wiki
|
||||
Expect(VersionNumber(0x51303039).String()).To(Equal("gQUIC 9"))
|
||||
Expect(VersionNumber(0x51303133).String()).To(Equal("gQUIC 13"))
|
||||
|
||||
Reference in New Issue
Block a user