I would also add to Dan's comment a note about:

> Note that for some resolvers, it may be necessary to back translate their 
> response code to the DNS RFCs'.  But that work ends up in curllib, not in the 
> application.

Assuming that it would be always possible to translate back resolver-specific 
codes into some general "DNS codes" (although it might be not always the case), 
such translation logic will create a dependency on the resolver.
So, whenever the resolver add/modify/remove its internal codes in a new 
version, libcurl will have to update the translation layer (if it is 
implemented there) to keep it up to date.
And for multiple resolvers, it will be a maintenance mess.

On the other hand, the application knows which resolver (and which specific 
version) it uses, so it can update the translation layer (code-to-text,  if it 
needs it) once it updates the resolver version.

Returning an opaque resolver code in case of host resolution failures is enough 
debug information for application developers to build application-specific 
resolver translation layers, which will be aligned with resolver versions their 
application is using (i.e. specific version of c-ares etc).


-----Original Message-----
From: curl-library <curl-library-boun...@lists.haxx.se> On Behalf Of Dan 
Fandrich via curl-library
Sent: Tuesday, April 19, 2022 3:26 PM
To: curl-library@lists.haxx.se
Cc: Dan Fandrich <d...@coneharvesters.com>
Subject: Re: Feature request about curlinfo option returning resolver 
status/error code

On Tue, Apr 19, 2022 at 04:14:23PM -0400, Timothe Litt via curl-library wrote:
> No.  No need to invent abstract codes.  Use the DNS RCODE + (if 
> available) the ENS EDNS0 EDE (RFC8914).

But do those codes include errors that only a local resolver might face? Things 
like access or syntax errors on /etc/resolv.conf, inability to connect to the 
local resolver daemon, or out of memory? In just looking at the set of c-ares 
error codes, they're defined in sections with 6 in the "server error codes"
section and 11 in the "locally-generated error codes" section.
--
Unsubscribe: https://lists.haxx.se/listinfo/curl-library
Etiquette:   https://curl.haxx.se/mail/etiquette.html
-- 
Unsubscribe: https://lists.haxx.se/listinfo/curl-library
Etiquette:   https://curl.haxx.se/mail/etiquette.html

Reply via email to