Skip to content

Commit

Permalink
create a milestone version for 0.11.1
Browse files Browse the repository at this point in the history
  • Loading branch information
marten-seemann committed Apr 9, 2019
1 parent a63ee3d commit 8dcdf12
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
10 changes: 6 additions & 4 deletions internal/protocol/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,16 @@ const (

// The version numbers, making grepping easier
const (
VersionTLS VersionNumber = 0x51474fff
VersionTLS VersionNumber = VersionMilestone0_11_1
VersionWhatever VersionNumber = 1 // for when the version doesn't matter
VersionUnknown VersionNumber = math.MaxUint32

VersionMilestone0_11_1 VersionNumber = 0xff000013 // QUIC WG draft-19
)

// SupportedVersions lists the versions that the server supports
// must be in sorted descending order
var SupportedVersions = []VersionNumber{VersionTLS}
var SupportedVersions = []VersionNumber{VersionMilestone0_11_1}

// IsValidVersion says if the version is known to quic-go
func IsValidVersion(v VersionNumber) bool {
Expand All @@ -38,8 +40,8 @@ func (vn VersionNumber) String() string {
return "whatever"
case VersionUnknown:
return "unknown"
case VersionTLS:
return "TLS dev version (WIP)"
case VersionMilestone0_11_1:
return "QUIC WG draft-19"
default:
if vn.isGQUIC() {
return fmt.Sprintf("gQUIC %d", vn.toGQUICVersion())
Expand Down
3 changes: 2 additions & 1 deletion internal/protocol/version_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ var _ = Describe("Version", func() {

It("says if a version is valid", func() {
Expect(IsValidVersion(VersionTLS)).To(BeTrue())
Expect(IsValidVersion(VersionMilestone0_11_1)).To(BeTrue())
Expect(IsValidVersion(VersionWhatever)).To(BeFalse())
Expect(IsValidVersion(VersionUnknown)).To(BeFalse())
Expect(IsValidVersion(1234)).To(BeFalse())
Expand All @@ -22,7 +23,7 @@ var _ = Describe("Version", func() {
})

It("has the right string representation", func() {
Expect(VersionTLS.String()).To(ContainSubstring("TLS"))
Expect(VersionMilestone0_11_1.String()).To(ContainSubstring("QUIC WG draft-19"))
Expect(VersionWhatever.String()).To(Equal("whatever"))
Expect(VersionUnknown.String()).To(Equal("unknown"))
// check with unsupported version numbers from the wiki
Expand Down

0 comments on commit 8dcdf12

Please sign in to comment.