refactor(sessionresolver): replace dnsclientmaker with function (#811)
See https://github.com/ooni/probe/issues/2135
This commit is contained in:
parent
a02cc6100b
commit
bf7ea423d3
6 changed files with 62 additions and 166 deletions
|
|
@ -59,13 +59,13 @@ type Resolver struct {
|
|||
// we will construct a default codec.
|
||||
jsonCodec jsonCodec
|
||||
|
||||
// dnsClientMaker is the OPTIONAL dnsclientmaker to
|
||||
// use. If not set, we will use the default.
|
||||
dnsClientMaker dnsclientmaker
|
||||
|
||||
// mu provides synchronisation of internal fields.
|
||||
mu sync.Mutex
|
||||
|
||||
// newChildResolverFn is the OPTIONAL function to override
|
||||
// the construction of a new resolver in unit tests
|
||||
newChildResolverFn func(h3 bool, URL string) (model.Resolver, error)
|
||||
|
||||
// once ensures that CloseIdleConnection is
|
||||
// run just once.
|
||||
once sync.Once
|
||||
|
|
|
|||
Loading…
Reference in a new issue