aboutsummaryrefslogtreecommitdiff
path: root/ares/ares_init.c
AgeCommit message (Collapse)Author
2009-11-09Test for USE_WINSOCK since it is more restrictive than WIN32Yang Tse
2009-11-02Renamed c-ares setup.h to ares_setup.hYang Tse
2009-10-10Fix compiler warning: loop without bodyYang Tse
2009-10-08Fix compiler warningYang Tse
2009-09-17Attempt to silence bogus compiler warning: "Potential null pointer dereference"Yang Tse
2009-09-07Suppress warnings about unused prototypes in Watt32 and Win32 programs.Gisle Vanem
2009-08-03- Joshua Kwan fixed the init routine to fill in the defaults for stuff thatDaniel Stenberg
fails to get inited by other means. This fixes a case of when the c-ares init fails when internet access is fone.
2009-06-12Revert last change, it is inappropriate.Yang Tse
2009-06-12Replace CURLDEBUG with DEBUGBUILD.Gisle Vanem
2009-05-26Make ares_init(), ares_dup() and ares_init_options() return ARES_ENOTINITIALIZEDYang Tse
if library initialization has not been performed calling ares_library_init().
2009-05-17Introduction of ares_library_init() and ares_library_cleanup()Yang Tse
2009-04-22avoid use of alloca()Yang Tse
2009-04-21Moved potential inclusion of system's malloc.h and memory.h header files toYang Tse
setup_once.h. Inclusion of each header file is based on the definition of NEED_MALLOC_H and NEED_MEMORY_H respectively.
2008-12-04Gregor Jasny provided the patch that introduces ares_set_socket_callback(),Daniel Stenberg
and I edited it to also get duped by ares_dup().
2008-12-03Introduce ares_dup(3) and new thoughts about API/ABI and how to move forwards.Daniel Stenberg
Also discussed on the ml.
2008-12-01minor indent fixDaniel Stenberg
2008-12-01Convert the public config struct to the same binary size/construct as in theDaniel Stenberg
latest releases to remain ABI compatible.
2008-11-28Make use of gethostname() conditional on it being availableDan Fandrich
2008-11-25In preparation for the upcomming IPv6 nameservers patch, the internalYang Tse
ares_addr union is now changed into an internal struct which also holds the address family.
2008-11-20use unsigned short better intead of mixing with ints to prevent compilerDaniel Stenberg
warnings
2008-11-01- Carlo Contavalli added support for the glibc "rotate" option, as documentedDaniel Stenberg
in man resolv.conf: causes round robin selection of nameservers from among those listed. This has the effect of spreading the query load among all listed servers, rather than having all clients try the first listed server first every time. You can enable it with ARES_OPT_ROTATE
2008-09-17adjust inclusion of "nameser.h"Yang Tse
2008-09-16code cleanupYang Tse
2008-09-15include header file only when availableYang Tse
2008-09-11move inclusion of ares_private.h lastYang Tse
2008-09-06remove unnecessary typecasting of malloc()Yang Tse
2008-08-04- Fix by Tofu Linden:Daniel Stenberg
The symptom: * Users (usually, but not always) on 2-Wire routers and the Comcast service and a wired connection to their router would find that the second and subsequent DNS lookups from fresh processes using c-ares to resolve the same address would cause the process to never see a reply (it keeps polling for around 1m15s before giving up). The repro: * On such a machine (and yeah, it took us a lot of QA to find the systems that reproduce such a specific problem!), do 'ahost www.secondlife.com', then do it again. The first process's lookup will work, subsequent lookups will time-out and fail. The cause: * init_id_key() was calling randomize_key() *before* it initialized key->state, meaning that the randomness generated by randomize_key() is immediately overwritten with deterministic values. (/dev/urandom was also being read incorrectly in the c-ares version we were using, but this was fixed in a later version.) * This makes the stream of generated query-IDs from any new c-ares process be an identical and predictable sequence of IDs. * This makes the 2-Wire's default built-in DNS server detect these queries as probable-duplicates and (erroneously) not respond at all.
2008-06-30- As was pointed out to me by Andreas Schuldei, the MAXHOSTNAMELEN define isDaniel Stenberg
not posix or anything and thus c-ares failed to build on hurd (and possibly elsewhere). The define was also somewhat artificially used in the windows port. Now, I instead rewrote the use of gethostbyname to enlarge the host name buffer in case of need and totally avoid the use of the MAXHOSTNAMELEN define. I thus also removed the defien from the namser.h file where it was once added for the windows build. I also fixed init_by_defaults() function to not leak memory in case if error.
2008-05-15use same time source for timeout initialization and processingYang Tse
2008-05-13- Introducing millisecond resolution support for the timeout option. SeeDaniel Stenberg
ares_init_options()'s ARES_OPT_TIMEOUTMS.
2008-05-05Improved parsing of resolver configuration filesYang Tse
2008-04-04Eino Tuominen improved the code when a file is used to seed the randomizerDaniel Stenberg
2007-10-22removed dependency on gettimeofday() since we use only 1 sec resolution here.Gunter Knauf
2007-10-20Fix compiler warning: conversion from "int" to "unsigned short" may lose ↵Yang Tse
significant bits
2007-10-18Renamed a variable to avoid shadowing a global declarationYang Tse
2007-10-18Fix compiler warning: conversion from "int" to "unsigned char"Yang Tse
may lose significant bits
2007-10-02Avoid a segfault when generating a DNS "Transaction ID" in internalYang Tse
function init_id_key() under low memory conditions.
2007-09-29Previously, processing a large batch of timeouts was O(n^2) in the number ofSteinar H. Gunderson
outstanding queries, and processing a DNS response packet was O(n) in the number of outstanding queries. To speed things up in Google, we added a few circular, doubly-linked lists of queries that are hash-bucketed based on the attributes we care about, so most important operations are now O(1). It might be that the number of buckets are higher than most people would need, but on a quick calculation it should only be 100kB or so even on a 64-bit system, so I've let it stay as-is.
2007-09-28Support a few more socket options, and refactor the option setting a bit. ↵Steinar H. Gunderson
(Patch from the Google tree.)
2007-09-28Three fixes in one commit (sorry): a) Take care of the tcpbuf if it ends ↵Steinar H. Gunderson
while queued for transmission, note broken servers and close them in the main loop, and store TCP socket generation number in order not to send the same query twice over the same socket.
2007-09-22Brad House provided a fix for ares_save_options(): Apparently I overlookedDaniel Stenberg
something with the ares_save_options() where it would try to do a malloc(0) when no options of that type needed to be saved. On most platforms, this was fine because malloc(0) doesn't actually return NULL, but on AIX it does, so ares_save_options would return ARES_ENOMEM.
2007-07-14Brad House's fix to hish a win32 compiler warningDaniel Stenberg
2007-07-14Vlad Dinulescu fixed two outstanding valgrind reportsDaniel Stenberg
2007-07-03few minor changes to make ares compile for NetWare CLIB architecture.Gunter Knauf
2007-06-02Brad Spencer found and fixed three flaws in the code, found with the newDaniel Stenberg
gcc 4.2.0 warning: -Waddress
2007-05-30first take at detecting a random device and seeding the random key using dataDaniel Stenberg
from it in randomize_key()
2007-05-30Shmulik Regev brought cryptographically secure transaction IDsDaniel Stenberg
2007-05-30Brad House added ares_save_options() and ares_destroy_options() that can beDaniel Stenberg
used to keep options for later re-usal when ares_init_options() is used.
2007-05-25Ravi Pratap fixed a flaw in the init_by_resolv_conf() function for windowsDaniel Stenberg
that could cause it to return a bad return code.
2007-02-26Removed inclusion of <sys/types.h> in .c-filesGisle Vanem
since it's already included through "setup.h".