From 4f346b08b33c9265c36fe8a14f5f908b1a9f296a Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Sun, 1 Apr 2012 23:22:16 -0400 Subject: improve name lookup performance in corner cases 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. --- src/network/getaddrinfo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/network/getaddrinfo.c') diff --git a/src/network/getaddrinfo.c b/src/network/getaddrinfo.c index e5fa5191..93c75160 100644 --- a/src/network/getaddrinfo.c +++ b/src/network/getaddrinfo.c @@ -61,7 +61,7 @@ int getaddrinfo(const char *host, const char *serv, const struct addrinfo *hint, //char hostbuf[256]; char line[512]; FILE *f, _f; - unsigned char _buf[64]; + unsigned char _buf[1024]; char *z; int result; int cnt; -- cgit v1.2.1