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. 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. OTOH, if we provide all the options at compile time, we may end not knowing whether they're still used or not. -- Cheers Jorge.-