about summary refs log tree commit diff
path: root/src/network/__dns.c
Commit message (Collapse)AuthorAgeFilesLines
* de-duplicate dn_expand, fix return value and signature, clean upRich Felker2013-08-141-27/+3
| | | | | | | | | | | | | | | | | the duplicate code in dn_expand and its incorrect return values are both results of the history of the code: the version in __dns.c was originally written with no awareness of the legacy resolver API, and was later copy-and-paste duplicated to provide the legacy API. this commit is the first of a series that will restructure the internal dns code to share as much code as possible with the legacy resolver API functions. I have also removed the loop detection logic, since the output buffer length limit naturally prevents loops. in order to avoid long runtime when encountering a loop if the caller provided a ridiculously long buffer, the caller-provided length is clamped at the maximum dns name length.
* fix some more O_CLOEXEC/SOCK_CLOEXEC issuesRich Felker2012-09-291-3/+1
|
* improve name lookup performance in corner casesRich Felker2012-04-011-1/+1
| | | | | | | | | | | the buffer in getaddrinfo really only matters when /etc/hosts is huge, but in that case, the huge number of syscalls resulting from a tiny buffer would seriously impact the performance of every name lookup. the buffer in __dns.c has also been enlarged a bit so that typical resolv.conf files will fit fully in the buffer. there's no need to make it so large as to dominate the syscall overhead for large files, because resolv.conf should never be large.
* fix for previous incorrect fix of cancellation in dns lookupsRich Felker2012-02-231-3/+4
| | | | | uninitialized file descriptor was being closed on return, causing stdin to be closed in many cases.
* fix default nameserver when resolv.conf doesn't existRich Felker2012-02-111-1/+2
|
* fix illegal goto out of cleanup context in dns lookupsRich Felker2012-02-111-3/+3
|
* make dns lookups (and thus getaddrinfo) cancellableRich Felker2011-09-211-4/+11
|
* use poll rather than select in dns lookups (also clock_gettime)Rich Felker2011-09-211-12/+10
| | | | | | | | | | if the file descriptor resource limit has been increased past FD_SETSIZE, this is actually a security issue; we could write past the end of the fd_set object. using poll makes it a non-issue, and simplifies the code at the same time. also, use clock_gettime instead of gettimeofday, for reduced bloat and better entropy.
* dns lookups: protect against cancellation and fix incorrect error codesRich Felker2011-04-181-4/+10
|
* fix broken dns response parsing code that made most ipv6 lookups failRich Felker2011-04-081-4/+6
|
* fix uninitialized variables in dns lookup codeRich Felker2011-04-071-2/+2
|
* another pointer signedness fixRich Felker2011-02-141-1/+1
|
* initial check-in, version 0.5.0 v0.5.0Rich Felker2011-02-121-0/+267