Skip to content

Commit

Permalink
create a milestone version for v0.13.x, update HTTP/3 to h3-23
Browse files Browse the repository at this point in the history
  • Loading branch information
marten-seemann committed Nov 9, 2019
1 parent a50b174 commit 1c3600f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion http3/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ var (
quicListenAddr = quic.ListenAddr
)

const nextProtoH3 = "h3-22"
const nextProtoH3 = "h3-23"

type requestError struct {
err error
Expand Down
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_13
VersionWhatever VersionNumber = 1 // for when the version doesn't matter
VersionUnknown VersionNumber = math.MaxUint32

VersionMilestone0_13 VersionNumber = 0xff000017 // QUIC WG draft-23
)

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

// 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_13:
return "QUIC WG draft-23"
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_13)).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_13.String()).To(ContainSubstring("QUIC WG draft-23"))
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 1c3600f

Please sign in to comment.