cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: asynchronous dns for multi interface

From: Steve Dekorte <stevedekorte_at_yahoo.com>
Date: Tue, 18 Jun 2002 20:06:59 -0700 (PDT)

--- Daniel Stenberg <daniel_at_haxx.se> wrote:
> On Mon, 17 Jun 2002, Steve Dekorte wrote:
> > I'd like to get gnu adns working with the curl
> multi interface.
>
> adns always seemed like an overly complex api for
> just getting names to
> resolve asynchronously, but I'm not the one to
> judge.
>
> The fact that the package is GPL also prevents me
> from using this within
> libcurl. It is also IPv4-only.

That's a good point. Are there any other multiplatform
async dns libs?

>
> > What's the best way to intercept the host look
> lookup? I'd like to do it in
> > a way that's compatible with the curl's dns cache.
>
> All name lookups are done with the Curl_resolv()
> function call.
>
> But since we don't have asynch lookups today, we
> don't really have good
> support for dealing with them either.
>
> We should probably make a separate new state for the
> multi interface to deal
> with name resolves, so that it can return back
> properly and continue on the
> other easy handles while the DNS reply hasn't
> returned for that particular
> handle's name resolve. It would require some minor
> rearranging of internals,
> but I don't expect that to be very extensive.

I got gnu adns working with curl from the outside(I
replace the domain with the ip before handing the url
to curl and do my own caching).

I think an ideal solution would be to provide a dns
callback. If set, curl would call a specified c
function with the url and the handle. This callback
would return immediately. After the lookup is
complete, it the user code would call a standard curl
api with the handle and result ip.

However, that's a lot of work to implement. The quick
route would be to provide a API for parsing urls and a
example code for using the multi api with gnu adns.

I'll try to put something together.

Cheers,
Steve

__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com

----------------------------------------------------------------------------
                   Bringing you mounds of caffeinated joy
>>> http://thinkgeek.com/sf <<<
Received on 2002-06-19