Remove bool for IterativeResolution in resolver config since we have separate methods and keep it only in the CliConf struct
Re-worked this to have better handling of the combined time outs of --timeout and --iteration-timeout
Updated documentation
Use the new Exchange...Context functions in zmap/dns to pass the timeout context in and get the advantage of failing fast here.
Disambiguate the reason for timeout in iterativeLookup
Testing
Was a bit difficult to test, but added a time.Sleep(time.Second) into the lookup section of the code and alternated between --timeout 1 and --iteration-timeout 1 to see what error was returned.
~/zdns/zdns-working on phillip/363-no-timeout-change! ⌚ 12:11:05
$ echo "amazon.com" | ./zdns A --iteration-timeout 1 --timeout 4 --iterative
{"data":{"protocol":"","resolver":""},"name":"amazon.com","status":"ITERATIVE_TIMEOUT","timestamp":"2024-06-11T12:11:14+09:00"}
~/zdns/zdns-working on phillip/363-no-timeout-change! ⌚ 12:11:14
$ echo "amazon.com" | ./zdns A --iteration-timeout 4 --timeout 1 --iterative
{"data":{"protocol":"","resolver":""},"name":"amazon.com","status":"TIMEOUT","timestamp":"2024-06-11T12:11:27+09:00"}
Closes #363
Changes
IterativeResolution
in resolver config since we have separate methods and keep it only in the CliConf struct--timeout
and--iteration-timeout
Exchange...Context
functions inzmap/dns
to pass the timeout context in and get the advantage of failing fast here.iterativeLookup
Testing
Was a bit difficult to test, but added a
time.Sleep(time.Second)
into the lookup section of the code and alternated between--timeout 1
and--iteration-timeout 1
to see what error was returned.Note - The
status
is correctly reported`