Hi Jorge, On Mon, Nov 05, 2007 at 12:38:16PM -0300, Jorge Arellano Cid wrote:
Hi Johannes,
On Sun, Nov 04, 2007 at 01:48:50PM +0100, Johannes Hofmann wrote:
Hello,
as I'm also using a BSD system, I converted the D_DNS_THREADED code to use the inherently thread-safe getaddrinfo(3) interface that also has some other advantages (e.g. a predictable ordering of the returned addresses). Jorge, what do you think about this? Are there supported platforms that do not have getaddrinfo? Should we add a compile option for this?
I gave it a look.
AFAIS there're a few ways to do it.
Considering that getaddrinfo is thread-safe by definition and also inside POSIX, it's a good candidate. The gethostbyname* family is thread-safe in glibc2, but who knows in other libraries.
dns.c has too much #defines for my taste (yes, I wrote it! ;-), and getting rid of the libc5 lines may also help simplicity.
Exactly.
I'd say, get the current CVS (patch applied), please also convert Dns_blocking_server to getaddrinfo, and get rid of libc5 lines. That way we end with a cleaner dns.c and will know for sure who still may need the missing lines, because they can ask in dillo-dev.
Ok, I will do that. I also think we should keep the Dns_blocking_server for now.
OTOH, if we provide all the options at compile time, we may end not knowing whether they're still used or not.
Very true. Cheers, Johannes