Subject: Re: [Patch] Add ares_gethostbyname_files() function

Re: [Patch] Add ares_gethostbyname_files() function

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Wed, 19 Nov 2008 16:05:10 +0100 (CET)

On Wed, 19 Nov 2008, Yang Tse wrote:

> I know that the fact that the internal file lookup method is blocking is a
> c-ares issue. But before applying your patch this was something that someone
> might someday fix to allow asynchronous lookups and not get blocked when
> using a 600 kb hosts file.
>
> If the above is someday fixed and this patch has been applied the blocking
> functionality of the new ares_gethostbyname_file() would have to be kept
> around.

I agree that a huge file or just one read from a slow device/media/network
will take a long time and that's not terribly nice doing in a blocking style -
for a supposedly non-blocking library like c-ares.

But still, I can see how this function is convenient and if we one day get a
non-blocking version I doubt it'll be a very big hurdle to keep this blocking
one supported.

> I have no preferences towards accepting or rejecting the patch, so I'll
> leave that for Daniel ;-)

It's very low-impact in added size and complexity so I'll proceed and commit
it! Thanks Brad!

-- 
  / daniel.haxx.se
Received on 2008-11-19