Re: Unit test 1655
Date: Wed, 13 Nov 2019 14:07:23 +0000
On 13 Nov 2019, at 13:41, Daniel Stenberg wrote:
> Is there a reason the DoH code can't just use with exactly the host
> name it gets passed, using a trailing dot or not?
That’s pretty-well the answer I was looking for.
I’m not aware of a compelling reason that it shouldn’t be tolerant,
just as you suggest, but wanted to be sure that I wasn’t missing
something.
Whether the trailing dot is present or not has to be taken into account
if an exact estimate (rather than a safe over-estimate) of the required
buffer size (constant `expected_len` in `doh_encode()`) is required.
For example, `“example.com”` and `“example.com.”`, although of
differing
lengths as strings, are both encoded as the same QNAME
`(6)example(3)com(0)`.
For accommodating corner cases, and for keeping the unit test as simple
as possible, I think I’ll add some complexity into the estimation of
`expected_len`.
/Niall
-------------------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
Etiquette: https://curl.haxx.se/mail/etiquette.html
Received on 2019-11-13