mirror of
https://github.com/hickory-dns/hickory-dns.git
synced 2026-04-25 11:15:54 +03:00
[GH-ISSUE #598] What should be iterated with trust_dns_proto::rr::rdata::txt::TXT.iter()? #540
Labels
No labels
blocked
breaking-change
bug
bug:critical
bug:tests
cleanup
compliance
compliance
compliance
crate:all
crate:client
crate:native-tls
crate:proto
crate:recursor
crate:resolver
crate:resolver
crate:rustls
crate:server
crate:util
dependencies
docs
duplicate
easy
easy
enhance
enhance
enhance
feature:dns-over-https
feature:dns-over-quic
feature:dns-over-tls
feature:dnsssec
feature:global_lb
feature:mdns
feature:tsig
features:edns
has workaround
ops
perf
platform:WASM
platform:android
platform:fuchsia
platform:linux
platform:macos
platform:windows
pull-request
question
test
tools
tools
trust
unclear
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/hickory-dns#540
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @kolbma on GitHub (Oct 30, 2018).
Original GitHub issue: https://github.com/hickory-dns/hickory-dns/issues/598
I'm wondering what should be iterated with the iter() method?
I've thought of split-up the TXT RR for the xyz=abc key-value-pairs separated by comma or semikolon. But I only get back one iteration with the complete TXT RR.
An iterable over multiple TXT RRs is also not the case, because these would be in multiple DnsResponse.answers()?!
So is there a bug and the key-value-pairs should be iterable or what is iterable?
@bluejekyll commented on GitHub (Oct 30, 2018):
This iter is exposing the underlying TXT format from RFC 1035:
https://tools.ietf.org/html/rfc1035#section-3.3.14
It is specified as a blob of one or more character strings, ie:
In the general case, I expect most people only associate a single character string with the TXT record, but the spec allows for any number of character strings in a single record, eg you'll usually only have an iteration with one element. Character strings in DNS are similar to C style strings, but have a length attribute before they are parsed from the binary stream. There is no implicit breaking across boundaries of
=or spaces or any other delimiter as you've noticed in your experiments. It would require a record to be created with the explicit desire of having more than on character string, which many tools may not make easy, thus most people probably only end up with a single character string.Hopefully this helps!
@kolbma commented on GitHub (Oct 31, 2018):
Ah. So many thanks, @bluejekyll . Your explanation is great. Didn't get it that it might be possible to put there multiple C strings in the RR. Maybe my DNS server wouldn't also parse files with "\0" in it. But it makes senses now ;-)