feat(netxlite): implement parallel resolver (#724)
This diff imports the parallel resolver from websteps winter 2022
edition, which was originally implemented here:
55231d73cd
See https://github.com/ooni/probe/issues/2096
This commit is contained in:
parent
0efd4ff130
commit
ec0561ea8c
3 changed files with 408 additions and 2 deletions
|
|
@ -1,5 +1,9 @@
|
|||
package netxlite
|
||||
|
||||
//
|
||||
// Serial resolver implementation
|
||||
//
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
|
|
@ -10,11 +14,13 @@ import (
|
|||
"github.com/ooni/probe-cli/v3/internal/model"
|
||||
)
|
||||
|
||||
// SerialResolver uses a transport and sends performs a LookupHost
|
||||
// SerialResolver uses a transport and performs a LookupHost
|
||||
// operation in a serial fashion (query for A first, wait for response,
|
||||
// then query for AAAA, and wait for response), hence its name.
|
||||
//
|
||||
// You should probably use NewSerialResolver to create a new instance.
|
||||
//
|
||||
// Deprecated: please use ParallelResolver in new code.
|
||||
type SerialResolver struct {
|
||||
// Encoder is the MANDATORY encoder to use.
|
||||
Encoder model.DNSEncoder
|
||||
|
|
@ -25,7 +31,7 @@ type SerialResolver struct {
|
|||
// NumTimeouts is MANDATORY and counts the number of timeouts.
|
||||
NumTimeouts *atomicx.Int64
|
||||
|
||||
// Txp is the underlying DNS transport.
|
||||
// Txp is the MANDATORY underlying DNS transport.
|
||||
Txp model.DNSTransport
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue