Skip to content

Commit

Permalink
x
Browse files Browse the repository at this point in the history
  • Loading branch information
ainghazal committed Oct 17, 2024
1 parent 1b70367 commit bcab63d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
8 changes: 0 additions & 8 deletions internal/experiment/openvpn/richerinput.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package openvpn

import (
"context"
"time"

"github.com/ooni/probe-cli/v3/internal/experimentconfig"
"github.com/ooni/probe-cli/v3/internal/model"
Expand Down Expand Up @@ -102,13 +101,6 @@ func (tl *targetLoader) Load(ctx context.Context) ([]model.ExperimentTarget, err
return tl.loadFromDefaultEndpoints()
}

// TODO: move to targets.
func lookupHost(ctx context.Context, hostname string, r model.Resolver) ([]string, error) {
ctx, cancel := context.WithTimeout(ctx, 10*time.Second)
defer cancel()
return r.LookupHost(ctx, hostname)
}

func (tl *targetLoader) loadFromDefaultEndpoints() ([]model.ExperimentTarget, error) {
targets := []model.ExperimentTarget{}

Expand Down
7 changes: 7 additions & 0 deletions internal/experiment/openvpn/targets.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"fmt"
"math/rand"
"slices"
"time"

"github.com/ooni/probe-cli/v3/internal/legacy/netx"
"github.com/ooni/probe-cli/v3/internal/model"
Expand Down Expand Up @@ -98,6 +99,12 @@ func resolveOONIAddresses(logger model.Logger) ([]string, error) {
return valid, nil
}

func lookupHost(ctx context.Context, hostname string, r model.Resolver) ([]string, error) {
ctx, cancel := context.WithTimeout(ctx, 10*time.Second)
defer cancel()
return r.LookupHost(ctx, hostname)
}

// pickOONIOpenVPNTargets crafts targets from the passed array of IP addresses.
func pickOONIOpenVPNTargets(ipaddrList []string) ([]string, error) {

Expand Down

0 comments on commit bcab63d

Please sign in to comment.