cURL / Mailing Lists / curl-library / Single Mail

curl-library

RE: ARES configuration

From: Michael Mastroianni <MMastroianni_at_choicestream.com>
Date: Thu, 3 Mar 2005 00:56:53 -0500

I ended up hacking my url.* and easy.* slightly. I now have

CURLcode Curl_open_dns(struct SessionHandle **curl,
                       int * aresCode,
                       const char * server1,
                       const char * server2)

The int * aresCode is for getting ares codes out when initializing ares.
If either or both of the server params is called and USE_ARES is
defined, this calls ares_init_by_options with the appropriate
parameters, otherwise it calls ares_init as Curl_open does now.

Likewise, I have

CURLcode curl_easy_init_dns(CURL ** curl,
                            int * aresCode,
                            const char * dns1,
                            const char * dns2)

Which just calls Curl_open_dns. This returns any error it gets, and
takes a CURL** as an output parameter (I suppose I could just as easily
passed a CURLcode * and returned a CURL *, now that I think about it). I
think having
access to error codes here is a good idea, because I had a problem where
I was leaking sockets somewhere else in my program, and was getting NULL
CURL objects back from curl_easy_init, and my call to get the CURL error
code was
segfaulting.....

Let me know what you think.

regards,
Michael

-----Original Message-----
From: curl-library-bounces_at_cool.haxx.se
[mailto:curl-library-bounces_at_cool.haxx.se] On Behalf Of Daniel Stenberg
Sent: Wednesday, March 02, 2005 5:40 PM
To: libcurl development
Subject: Re: ARES configuration

On Wed, 23 Feb 2005, Michael Mastroianni wrote:

> Would it be offensive to have another interface than curl_easy_init in
the
> main codebase (since I have to do this in any event, if it would help
anyone
> else, I could put it in), or should I just hack mine up?

Tell us what you have in mind and I promise we'll consider it!

-- 
      Daniel Stenberg -- http://curl.haxx.se -- http://daniel.haxx.se
       Dedicated custom curl help for hire: http://haxx.se/curl.html
Received on 2005-03-03