save version numbers such that can be written in big endian

This makes the version number representation consistent with the IETF
draft.
This commit is contained in:
Marten Seemann
2017-10-24 10:45:08 +07:00
parent e81795e49b
commit d98a11bb35
18 changed files with 68 additions and 65 deletions

View File

@@ -140,7 +140,7 @@ func chromeTestImpl(version protocol.VersionNumber, url string, blockUntilDone f
"--no-proxy-server=true",
"--origin-to-force-quic-on=quic.clemente.io:443",
fmt.Sprintf(`--host-resolver-rules=MAP quic.clemente.io:443 localhost:%s`, testserver.Port()),
fmt.Sprintf("--quic-version=QUIC_VERSION_%d", version),
fmt.Sprintf("--quic-version=QUIC_VERSION_%s", version.ToAltSvc()),
url,
}
utils.Infof("Running chrome: %s '%s'", getChromePath(), strings.Join(args, "' '"))

View File

@@ -35,7 +35,7 @@ var _ = Describe("Drop tests", func() {
downloadFile := func(version protocol.VersionNumber) {
command := exec.Command(
clientPath,
"--quic-version="+strconv.Itoa(int(version)),
"--quic-version="+version.ToAltSvc(),
"--host=127.0.0.1",
"--port="+strconv.Itoa(proxy.LocalPort()),
"https://quic.clemente.io/prdata",
@@ -50,7 +50,7 @@ var _ = Describe("Drop tests", func() {
downloadHello := func(version protocol.VersionNumber) {
command := exec.Command(
clientPath,
"--quic-version="+strconv.Itoa(int(version)),
"--quic-version="+version.ToAltSvc(),
"--host=127.0.0.1",
"--port="+strconv.Itoa(proxy.LocalPort()),
"https://quic.clemente.io/hello",

View File

@@ -4,7 +4,6 @@ import (
"bytes"
"fmt"
"os/exec"
"strconv"
"sync"
"github.com/lucas-clemente/quic-go/integrationtests/tools/testserver"
@@ -26,7 +25,7 @@ var _ = Describe("Integration tests", func() {
It("gets a simple file", func() {
command := exec.Command(
clientPath,
"--quic-version="+strconv.Itoa(int(version)),
"--quic-version="+version.ToAltSvc(),
"--host=127.0.0.1",
"--port="+testserver.Port(),
"https://quic.clemente.io/hello",
@@ -42,7 +41,7 @@ var _ = Describe("Integration tests", func() {
It("posts and reads a body", func() {
command := exec.Command(
clientPath,
"--quic-version="+strconv.Itoa(int(version)),
"--quic-version="+version.ToAltSvc(),
"--host=127.0.0.1",
"--port="+testserver.Port(),
"--body=foo",
@@ -59,7 +58,7 @@ var _ = Describe("Integration tests", func() {
It("gets a file", func() {
command := exec.Command(
clientPath,
"--quic-version="+strconv.Itoa(int(version)),
"--quic-version="+version.ToAltSvc(),
"--host=127.0.0.1",
"--port="+testserver.Port(),
"https://quic.clemente.io/prdata",
@@ -80,7 +79,7 @@ var _ = Describe("Integration tests", func() {
defer GinkgoRecover()
command := exec.Command(
clientPath,
"--quic-version="+strconv.Itoa(int(version)),
"--quic-version="+version.ToAltSvc(),
"--host=127.0.0.1",
"--port="+testserver.Port(),
"https://quic.clemente.io/prdata",

View File

@@ -66,7 +66,7 @@ var _ = Describe("Random RTT", func() {
command := exec.Command(
clientPath,
"--quic-version="+strconv.Itoa(int(version)),
"--quic-version="+version.ToAltSvc(),
"--host=127.0.0.1",
"--port="+strconv.Itoa(proxy.LocalPort()),
"https://quic.clemente.io/prdata",

View File

@@ -32,7 +32,7 @@ var _ = Describe("non-zero RTT", func() {
command := exec.Command(
clientPath,
"--quic-version="+strconv.Itoa(int(version)),
"--quic-version="+version.ToAltSvc(),
"--host=127.0.0.1",
"--port="+strconv.Itoa(proxy.LocalPort()),
"https://quic.clemente.io/prdata",