aboutsummaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
authorRasmus Dahlberg <rasmus@rgdd.se>2023-04-01 10:12:42 +0200
committerRasmus Dahlberg <rasmus@rgdd.se>2023-04-01 10:12:42 +0200
commit9b84f21daf8196c883ede8f50c99c479b3ef0cbb (patch)
treec79f2e1aaa4813d0826f2c3c5372b332ef6e091e /main.go
parent58368a3141377bfb4e9629494c0533c18de896ae (diff)
Rip out -c and -C
Helpful for systemd-resolved issue, but unlikely to help if the issue is e.g. recursive DNS resolver that drops look-ups as -c will be cached.
Diffstat (limited to 'main.go')
-rw-r--r--main.go30
1 files changed, 0 insertions, 30 deletions
diff --git a/main.go b/main.go
index 32c9a6b..9725d98 100644
--- a/main.go
+++ b/main.go
@@ -62,15 +62,6 @@ func main() {
await(ctx, cancel)
}()
- if opts.CheckerDomain != "" {
- log.Printf("INFO: starting checker\n")
- go func() {
- wg.Add(1)
- defer wg.Done()
- checker(ctx, cancel, &opts, cli)
- }()
- }
-
log.Printf("INFO: starting %d workers with rate-limit %d requests/s\n", opts.NumWorkers, opts.Limit)
for i := 0; i < opts.NumWorkers; i++ {
go func() {
@@ -110,27 +101,6 @@ func await(ctx context.Context, cancel context.CancelFunc) {
cancel()
}
-func checker(ctx context.Context, cancel context.CancelFunc, opts *options.Options, cli *http.Client) {
- question := qna.Question{opts.CheckerDomain}
- answerCh := make(chan qna.Answer, 1)
- defer close(answerCh)
-
- for {
- select {
- case <-ctx.Done():
- return
- case <-time.After(opts.CheckerInterval):
- work(ctx, opts, cli, question, answerCh)
- answer := <-answerCh
- if answer.HTTP == "" && answer.HTML == "" {
- log.Printf("ERROR: checker expected onion for %+v", answer)
- cancel()
- return
- }
- }
- }
-}
-
func workHandler(ctx context.Context, opts options.Options, cli *http.Client, questionCh chan qna.Question, answerCh chan qna.Answer) {
for {
select {