Commit Graph

3 Commits (v4.8)

Author SHA1 Message Date
rofl0r 5526afb56d FreeBSD support 2012-12-25 19:08:05 +01:00
rofl0r 5ecd5ac51d fix compilation on musl libc 2012-12-18 09:38:32 +01:00
rofl0r af5c6f0c6a replace hostent lookup with better performing in-memory copy.
the central dns resolver function proxy_gethostbyname() used
to iterate over the gethostent() db (/etc/hosts) on each dns
request.
since this is not threadsafe, we synchronized access to it
previously using mutexes. the parsing of this file is slow,
and blocking all threads to do it even moreso.
since gethostent_r() is only available on a few platforms,
i decided to read the hostent db once and then use a quick
in-memory lookup on further usage.

+ some further refactoring.
2012-11-08 01:18:19 +01:00