cleanup(netx): remove the DNSClient type (#660)

The DNSClient type existed because the Resolver type did not
include CloseIdleConnections in its signature.

Now that Resolver includes CloseIdleConnections, the DNSClient
type has become unnecessary and can be safely removed.

See https://github.com/ooni/probe/issues/1956.
This commit is contained in:
Simone Basso
2022-01-10 11:53:06 +01:00
committed by GitHub
parent 730373cc75
commit d3c6c11e48
4 changed files with 36 additions and 58 deletions
@@ -26,7 +26,7 @@ type Configurer struct {
// The Configuration is the configuration for running a measurement.
type Configuration struct {
HTTPConfig netx.Config
DNSClient netx.DNSClient
DNSClient model.Resolver
}
// CloseIdleConnections will close idle connections, if needed.
@@ -82,7 +82,7 @@ func (c Configurer) NewConfiguration() (Configuration, error) {
return configuration, err
}
configuration.DNSClient = dnsclient
configuration.HTTPConfig.BaseResolver = dnsclient.Resolver
configuration.HTTPConfig.BaseResolver = dnsclient
// configure TLS
configuration.HTTPConfig.TLSConfig = &tls.Config{
NextProtos: []string{"h2", "http/1.1"},