Add systemd-resolved implementation of GResolver
On distros which use systemd-resolved, it might make more sense to use a systemd-resolved-specific GResolver
implementation than to continue to use GThreadedResolver
, which uses getaddrinfo()
in an internal thread pool.
This is because on such systems, getaddrinfo()
basically just calls through to an NSS module provided by systemd-resolved, which talks to the systemd-resolved daemon. In the process, support for timeouts, detailed error replies, or asynchronous calls are dropped from the API.
Implementing a systemd-resolved GResolver
implementation would cut out the limiting getaddrinfo()
API, the thread pool needed to use it, and the NSS module to talk to systemd-resolved. The new GResolver
implementation could just talk to systemd-resolved directly over D-Bus.
The GThreadedResolver
implementation would have to stick around for Linux systems which don’t use systemd-resolved
, or other Unix systems which only provide getaddrinfo()
. It’s an open question as to whether the choice of GThreadedResolver
or GSystemdResolvedResolver
should be made at compile time or runtime. Probably the latter to allow for systems where systemd-resolved is a packaging option open to users, but that’s more complex.