curl-library
Re: c-ares refreshing resolv.conf
Date: Tue, 8 Feb 2011 13:44:04 -0700
I think explicit (a)res_init is an ugly hack, in glibc too.
If c-ares can only reload dns servers (and other settings)
explicitely, then it ought to export all the files (or registry keys)
that it may consider. I'm not entirely sure if that's a wise thing to
do, as tracking those is an extra dependency for the user.
I'll start with explicit reload function, and add a configurable
automatic kludge that polls every resolution timeout for now. When
that works, it's up to Daniel to include that into trunk or not.
dima
On 8 February 2011 03:22, Kamil Dudka <kdudka_at_redhat.com> wrote:
> On Tuesday 08 February 2011 09:01:19 Dirk Manske wrote:
>> Polling is always an ugly solution. If you really want to poll
>> /etc for changes every X seconds, then that X should be
>> configurable.
>>
>> But I would use (on Linux) inotify (in my program, not libcurl)
>> to watch resolv.conf etc. for changes and trigger the reload
>> function.
>
> In the Fedora installer, we use res_init(3) to force glibc to re-read
> /etc/resolv.conf. It would be nice if libcurl provided a wrapper around
> it and then call the c-ares specific routine in case curl is built
> against c-ares.
>
> Kamil
>
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2011-02-08