httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alexei Kosut <ako...@nueva.pvt.k12.ca.us>
Subject Re: Win32 Progress Report
Date Sun, 04 Aug 1996 20:08:28 GMT
On Sun, 4 Aug 1996, Robert S. Thau wrote:

>   I ran into some problems with DNS (nothing I couldn't solve with enough
>   time, I don't think)...
> 
> Hmmm... I would have expected the normal library gethostbyname() and
> ...byaddr() interfaces to just work with anybody's native thread
> interface (by which I mean blocking only the calling thread, in

Hah. You'd think they would, wouldn't you. Apparently the people who
wrote the Solaris threads disagree with you. gethostbyname() and the
rest, in Solaris 2.5 at least, use static buffers, so they're not
threadsafe. Sun provides a set of routines (gethostbyname_r() and so
forth), where you provide buffers, that are thread-safe, but they're
not POSIX, and the man pages warn that they "are  subject  to change
or removal in future minor releases." Grr.

> addition to getting the right answer, of course).  These wouldn't give
> you the TTL return value which the RSthreads routines supply (if
> you're redoing it anyway, you might as well do it right, or so I
> figured ;-), but the existing server code doesn't actually use them
> anyway.
>
> (The TTL values are actually meant for maintenance of a local cache,
> which would be *required* to respect DNS TTL --- that's time-to-live,
> or to put it another way, expiration --- information, as of HTTP/1.1.

Yeah. I know.

> Such a cache is generally be maintained by the nameserver itself,
> independantly of the web server, of course, and you can think of the
> DNS protocol, or at least the subset of it which rsthreads_dns uses,
> as a way of formatting RPCs to get at it).

Of course, just calling gethostbyname() each time makes the OS deal
with it, at the expense of some speed, if you have a stupid OS that
doesn't have a built-in DNS cache (most don't, unfortunately).

-- 
________________________________________________________________________
Alexei Kosut <akosut@nueva.pvt.k12.ca.us>      The Apache HTTP Server
URL: http://www.nueva.pvt.k12.ca.us/~akosut/   http://www.apache.org/


Mime
View raw message