cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: ARES configuration

From: codemastr <codemstr_at_ptd.net>
Date: Fri, 4 Mar 2005 12:47:08 -0500

Perhaps the best solution to this would be something like
curl_easy_init_opts. That would take parameters that would allow you to set
various "creation time" options. I'm sure c-ares isn't going to be the only
library that will ever require such a feature, so it sounds like it would be
something worth adding. Basically it would work like curl_easy_setopt except
this would be done when the object is created.

Any thoughts?

Dominick Meglio
----- Original Message -----
From: "Michael Mastroianni" <MMastroianni_at_choicestream.com>
To: "libcurl development" <curl-library_at_cool.haxx.se>
Sent: Thursday, March 03, 2005 12:56 AM
Subject: RE: ARES configuration

>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-04