refactor: return QueryPath from resolve_query, add mock upstream to tests

resolve_query now returns (BytePacketBuffer, QueryPath) so callers
and tests can inspect the resolution path without reading the query
log. Production call sites (UDP, DoT, DoH) destructure and ignore it.

The forwarding test now uses a mock UDP upstream that replies with a
canned response, asserting QueryPath::Forwarded instead of != Local.
This commit is contained in:
Razvan Dimescu
2026-04-13 07:51:14 +03:00
parent 48f67be2f1
commit b8ddc16027
3 changed files with 36 additions and 25 deletions

View File

@@ -113,7 +113,7 @@ async fn resolve_doh(
let questions = query.questions.clone();
match resolve_query(query, dns_bytes, src, ctx, Transport::Doh).await {
Ok(resp_buffer) => {
Ok((resp_buffer, _)) => {
let min_ttl = extract_min_ttl(resp_buffer.filled());
dns_response(resp_buffer.filled(), min_ttl)
}