fix(netxlite): clearly document quirk and make code robust (#468)
This quirk really saddens me. It's a piece of tech debt we're carrying over from the original netx implementation. We cannot remove it _until_ we have legacy netx code around. The second best thing we can do is to clearly move this code in a place where it's clear it's a quirk and write and use some extra code that makes sure the quirk's assumptions are always met. Sigh. See https://github.com/ooni/probe/issues/1591
This commit is contained in:
parent
ba5bae4769
commit
aa77867145
6 changed files with 153 additions and 77 deletions
|
|
@ -84,6 +84,9 @@ func (d *dialerResolver) DialContext(ctx context.Context, network, address strin
|
|||
// than just calling ReduceErrors. We are not ready to do that
|
||||
// yet, though. To do that, we need first to modify nettests so
|
||||
// that we actually avoid dialing when measuring.
|
||||
//
|
||||
// See also the quirks.go file. This is clearly a QUIRK.
|
||||
addrs = quirkSortIPAddrs(addrs)
|
||||
var errorslist []error
|
||||
for _, addr := range addrs {
|
||||
target := net.JoinHostPort(addr, onlyport)
|
||||
|
|
@ -93,7 +96,7 @@ func (d *dialerResolver) DialContext(ctx context.Context, network, address strin
|
|||
}
|
||||
errorslist = append(errorslist, err)
|
||||
}
|
||||
return nil, reduceErrors(errorslist)
|
||||
return nil, quirkReduceErrors(errorslist)
|
||||
}
|
||||
|
||||
// lookupHost performs a domain name resolution.
|
||||
|
|
|
|||
Loading…
Reference in a new issue