NameServerPool: prefer to return a NoRecordsFound response over a truncated non-error UDP response

This commit is contained in:
2024-07-17 09:32:39 +00:00
parent 8d4d123d4f
commit bcea3de9b0

View File

@@ -282,7 +282,12 @@ where
let tcp_err = match tcp_res {
res @ Ok(..) => return res.map_err(ProtoError::from),
Err(e) => e,
Err(e) => match e.kind() {
// a NoRecordsFound response contains more details than the truncated UDP
// response, like additionals/nameservers
ProtoErrorKind::NoRecordsFound { .. } => return Err(ProtoError::from(e)),
_ => e,
}
};
// Even if the UDP result was truncated, return that