Subject: Re: ares_reinit patch

Re: ares_reinit patch

From: Dima Tisnek <dimaqq_at_gmail.com>
Date: Tue, 22 Mar 2011 10:39:54 -0700

It seems there are two classes of c-ares users, those who initialize
it by calling ares_init, never set any options and use c-ares as a
simple asynchronous resolver, and those who call ares_init_options,
set loads of options (and often set servers explicitely) and thus use
c-ares as a toolbox for various name resolution problems.

So in a way, c-ares serves two distinct purposes.
Is it so, or am I missing something?

Currently ares_init(ch) and ares_init_options(ch, NULL, 0) mean the
same, and it appears to be a good convention.
This gets tricky if we are to include automatic reinitialization for
simple users without quietly introducing a change to toolbox users.

One way is to break init/init_options equality and include reinit
option (and possibly some default timeout) into ares_init call and
document that in the man page.

Another option is to split c-ares into two separate entities, say
c-ares-simple and c-ares-toolbox, projects like libcurl and iftop
would use simple and projects like lwip and xymon use the toolbox.

Comments, please!

Thanks,
Dima Tisnek
Received on 2011-03-22