fix(netxlite): http3 transport needs logging by default (#492)

Adapt other places where it was not using a logger to either choose
a reasonable logger or disable logging for backwards compat.

See https://github.com/ooni/probe/issues/1591
This commit is contained in:
Simone Basso
2021-09-08 20:49:01 +02:00
committed by GitHub
parent 18b2eb37ff
commit e68adec9a5
5 changed files with 35 additions and 16 deletions
@@ -8,6 +8,7 @@ import (
"sort"
"strings"
"github.com/apex/log"
"github.com/ooni/probe-cli/v3/internal/engine/experiment/websteps"
"github.com/ooni/probe-cli/v3/internal/netxlite"
"github.com/ooni/probe-cli/v3/internal/runtimex"
@@ -135,7 +136,9 @@ func (e *DefaultExplorer) getH3(h3URL *h3URL, headers map[string][]string) (*htt
tlsConf := &tls.Config{
NextProtos: []string{h3URL.proto},
}
transport := netxlite.NewHTTP3Transport(
// Rationale for using log.Log here: we're already using log.Log
// in this package, so it seems fair to use it also here
transport := netxlite.NewHTTP3Transport(log.Log,
netxlite.NewQUICDialerFromContextDialerAdapter(dialer), tlsConf)
// TODO(bassosimone): here we should use runtimex.PanicOnError
jarjar, _ := cookiejar.New(nil)