Default to only switch to TCP if response was truncated

Currently, if queries to name servers over UDP result in either a
truncated response, or any kind of error, the query will be retried over
TCP. It should be possible to only use TCP for the case of oversized
messages, and avoid it in the common case. This change makes this the
default behavior and adds an option to ResolverOpts that can be enabled
to get the current behavior.
This commit is contained in:
Peter Johnston
2021-10-06 21:14:22 +00:00
committed by Benjamin Fry
parent cb73fd9cc9
commit aefb6deded
6 changed files with 84 additions and 27 deletions

View File

@@ -598,6 +598,7 @@ pub mod testing {
ResolverConfig::default(),
ResolverOpts {
validate: true,
try_tcp_on_error: true,
..ResolverOpts::default()
},
handle,