Subject: RE: Asynchronous DNS - gethostbyname_r
From: "Robert Collins" <[email-masked]>
To: "Dustin Lang" <[email-masked]>
Cc: <[email-masked]>
Date: Wed, 1 Nov 2000 13:04:42 +1100

Ok, so I'm slightly off-topic...

> -----Original Message-----
> From: Dustin Lang [mailto:[email-masked]]
> Sent: Wednesday, 1 November 2000 11:04 AM
> To: Robert Collins
> Subject: Re: Asynchronous DNS - gethostbyname_r
> 
> 
> 
> Hi,
> 
> Isn't the net great - I ask a question about cygwin and 
> mention squid, and
> within a couple of hours I get a response from someone who's done work
> with cygwin and squid!

Truely :]
> 
> >     I'm not sure if this answers your question:
> > If you download the CVS head branch of squid 2.4 it has 
> asynchronous calls
> > for cygwin already patched in the source. It also uses 
> internal dns servers
> > so you don't get a dozen external process's.
> 
> Just glancing briefly over the dns_internal.c code, I note 
> that it reads 
> /etc/resolv.conf to find out the IP addresses of the nameservers to 
> use.  I don't want my program to require any special network 
> setup by the
> user - "IP numbers are scary!  Can't I just enter my DNS server's
> hostname?" - so I would ideally like to use the "native" 
> lookup calls like
> gethostbyname().  However, it looks as though I may have to 
> be flexible to
> solve this problem in a nice way :)  I wonder if the 
> currently-valid DNS
> server addresses are kept in the windows registry in a useful 
> place (and
> in a useful form)?  If so, it should be possible to poke 
> around in the 
> registry on startup to find out which DNS servers to use and 
> pass these on
> to the dns_internal code.  It would also be necessary to deal 
> with local
> lookups in the "hosts" file, though this wouldn't be very 
> difficult to do.

You need to do whatever ipconfig and winipcfg do. Also note that you
have different resolvers for different interfaces. One of the reasons I
ported squid was to have a local proxy on my windows machine ... Have
you considered enhancing squid rather than "re-inventing the wheel?"
(Not that I object to having a variety of tools around). I am suggesting
that because squid has things like ICP, multicasting and cache digests
that would be very useful if you are looking at running a distributed
caching system within a LAN-like environment. All you'd need to do is
add startup code to "autoconfigure" your environment..

And Squid (after a slow period of development) is now getting lots of
work done on it. For example - rfc 2616 transfer encoding & NTLM
authentication.

> I suppose it might not be _too_ hard to use WSAAsyncGetHostByName; I'd
> have to create an invisible window to receive the callback 
> messages, but
> it otherwise does what I want.

A word of warning: be careful mixing your cygwin and native windows
sockets calls. Search the cygwin and cygwin apps mailing lists for more
information :-].
> 
> Thanks for the pointers!
> dstn.
> 
> 
> 

--
Want to unsubscribe from this list?
Send a message to [email-masked]