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:
parent
2301a30630
commit
da1c13e312
8 changed files with 75 additions and 164 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue