cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Asynch DNS

From: codemastr <codemstr_at_ptd.net>
Date: Mon, 17 Mar 2003 13:16:32 -0500

> libcurl uses synchronous DNS lookups (as there are no portable
alternatives).
> I do hope to get libdenise (http://libdenise.sourceforge.net/) good enough
to
> add asynch lookups in the future, but that is still but a dream.
Well what I was thinking is something along the lines the the multi
interface. Meaning I handle DNS myself. I don't know if that is actually
doable on your end, but I think it would be the most flexible way. For
example in my program, DNS is handled within the main select() loop. So if
it were implemented the way I described, I could simply instruct my resolver
to query libcurl to see if it has any pending DNS requests by calling
curl_multi_dns_queries(). If there is, it returns an slist of all the
hostnames it needs to have resolved, if not, it returns NULL. I then handle
this in my resolver, and then I call say curl_multi_dns_perform() where I
pass an slist of hostents. Granted this system doesn't work 100%, but I'm
just throwing out basic ideas. The way I'm thinking is, you want to use
libdenise, well maybe I use adns, and I'd like to have adns serve all my DNS
requests (for whatever reason), if you handle the DNS yourself I really have
no control over that, but if an interface exists that allows me to worry
about DNS, then I can do it however I want.

-- codemastr

-------------------------------------------------------
This SF.net email is sponsored by:Crypto Challenge is now open!
Get cracking and register here for some mind boggling fun and
the chance of winning an Apple iPod:
http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0031en
Received on 2003-03-17