export qlog files if the QLOGDIR env is set in interop client and server

This commit is contained in:
Marten Seemann
2020-02-12 11:55:23 +07:00
parent 89728126cc
commit 5aaab80698
3 changed files with 46 additions and 3 deletions

View File

@@ -13,6 +13,7 @@ import (
"golang.org/x/sync/errgroup"
"github.com/lucas-clemente/quic-go"
"github.com/lucas-clemente/quic-go/http3"
"github.com/lucas-clemente/quic-go/internal/protocol"
"github.com/lucas-clemente/quic-go/interop/http09"
@@ -60,9 +61,18 @@ func runTestcase(testcase string) error {
flag.Parse()
urls := flag.Args()
getLogWriter, err := utils.GetQLOGWriter()
if err != nil {
return err
}
quicConf := &quic.Config{GetLogWriter: getLogWriter}
switch testcase {
case "http3":
r := &http3.RoundTripper{TLSClientConfig: tlsConf}
r := &http3.RoundTripper{
TLSClientConfig: tlsConf,
QuicConfig: quicConf,
}
defer r.Close()
return downloadFiles(r, urls)
case "handshake", "transfer", "retry":
@@ -76,7 +86,10 @@ func runTestcase(testcase string) error {
return errUnsupported
}
r := &http09.RoundTripper{TLSClientConfig: tlsConf}
r := &http09.RoundTripper{
TLSClientConfig: tlsConf,
QuicConfig: quicConf,
}
defer r.Close()
return downloadFiles(r, urls)
}