cleanup: remove UnderlyingNetworkLibrary and TProxy (#874)

* cleanup: remove UnderlyingNetworkLibrary and TProxy

While there, replace mixture of mocking and real connections inside
quicping with pure mocking of network connections.

Closes https://github.com/ooni/probe/issues/2224

* cleanup: we don't need a SimpleResolver now

This type was only used by UnderlyingNetworkLibrary and all the
rest of the code uses Resolver. So, let's avoid complexity by zapping
the SimpleResolver type and merging it inside Resolver.
This commit is contained in:
Simone Basso 2022-08-23 11:43:44 +02:00 committed by GitHub
commit da1c13e312
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 75 additions and 164 deletions

View file

@ -143,7 +143,7 @@ func NewDialerWithoutResolver(dl model.DebugLogger, w ...model.DialerWrapper) mo
return NewDialerWithResolver(dl, &NullResolver{}, w...)
}
// DialerSystem is a model.Dialer that uses TProxy.NewSimplerDialer
// DialerSystem is a model.Dialer that uses the stdlib's net.Dialer
// to construct the new SimpleDialer used for dialing. This dialer has
// a fixed timeout for each connect operation equal to 15 seconds.
type DialerSystem struct {
@ -160,7 +160,7 @@ func (d *DialerSystem) newUnderlyingDialer() model.SimpleDialer {
if t <= 0 {
t = dialerDefaultTimeout
}
return TProxy.NewSimpleDialer(t)
return &net.Dialer{Timeout: t}
}
func (d *DialerSystem) DialContext(ctx context.Context, network, address string) (net.Conn, error) {