Steinar H. Gunderson
c69f48b24f
Fix a double free.
2007-11-16 09:36:00 +00:00
Steinar H. Gunderson
d9dd239771
When looking up in DNS and then in the hosts file, return the error code from DNS if both fail, instead of returning the error code from the hosts file, as today. Patch from the Google tree.
2007-11-15 09:16:48 +00:00
Steinar H. Gunderson
b4bdb6d4d7
Return TTL data from ares_parse_{a,aaaa}_reply, if the user is so inclined. Patch from the Google tree.
2007-11-15 08:36:25 +00:00
Steinar H. Gunderson
6bd2b895fb
Fix a bug where fallback from AF_INET6 to AF_INET would not work properly together with relative search; if you had a search path of .a.com and .b.com, and foo.a.com would return ARES_ENODATA and foo.b.com would return ARES_ENOTFOUND, the lookup would not properly retry with AF_INET as it forgot the first ARES_ENODATA.
2007-10-16 21:27:51 +00:00
Steinar H. Gunderson
f75d1172f8
Removed a piece of redundant code (process_answer already takes care of it).
2007-10-04 08:12:12 +00:00
Steinar H. Gunderson
b7dec81498
Another timeout fix in ares_getnameinfo().
2007-10-04 08:09:52 +00:00
Steinar H. Gunderson
d5919bbe17
Send the timeout count in ares_getnameinfo().
2007-10-04 08:09:04 +00:00
Steinar H. Gunderson
4f438605ca
Moved the NULL check for channel upwards in ares_destroy().
2007-10-04 08:07:47 +00:00
Steinar H. Gunderson
47e86f021f
Clarified the comment over ares_cancel.
2007-10-04 08:06:25 +00:00
Steinar H. Gunderson
879f89a989
Fix a memory leak that I recently inadvertedly introduced.
2007-09-30 00:08:01 +00:00
Steinar H. Gunderson
60519063ea
Use ISDIGIT instead of isdigit; fixes a gcc warning.
2007-09-29 21:57:05 +00:00
Steinar H. Gunderson
ff7137ad74
Port the TCP socket fix made in ares_fds() to ares_getsock() as well.
2007-09-29 19:26:59 +00:00
Steinar H. Gunderson
04e49e09dc
Previously, processing a large batch of timeouts was O(n^2) in the number of
...
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-29 18:18:47 +00:00
Steinar H. Gunderson
13d4d28e11
TCP queries can time out too, not just UDP queries. (Patch from the Google tree.)
2007-09-29 14:25:14 +00:00
Steinar H. Gunderson
21feec7d2d
Read and process as many packets as possible in read_udp_packets, to avoid having to run the entire event loop once per packet. (Patch from the Google tree.)
2007-09-29 14:21:47 +00:00
Steinar H. Gunderson
2f7d637426
There are two different places in write_tcp_data() that advance the send_queue; however, they are slightly different and only the first one properly uses a while loop. Consolidate both into a single function that DTTR. (Patch from the Google tree.)
2007-09-29 14:09:14 +00:00
Steinar H. Gunderson
46f3220097
Reject names that are longer than 255 characters, to avoid problems with strict or buggy DNS server implementations. (Patch from the Google tree)
2007-09-29 13:58:23 +00:00
Steinar H. Gunderson
22c2794e76
In ares_mkquery, make sure we set buflen and buf to reasonable values if there's an error. (Patch from the Google tree)
2007-09-29 13:56:36 +00:00
Steinar H. Gunderson
cccd9a58cd
Be stricter about what's a valid IP address in fake_hostent. (Patch from the Google tree.)
2007-09-29 13:52:14 +00:00
Steinar H. Gunderson
49162e5b67
Handle the root of the DNS tree correctly in ares_expand_name.
2007-09-29 13:38:17 +00:00
Steinar H. Gunderson
3b5e49995f
Unrevert previous 'missing' hunks. They were missing since the patch is still in for review :-)
2007-09-28 15:56:28 +00:00
Steinar H. Gunderson
f785dbd9c4
Yet more missing hunks... Nggh.
2007-09-28 15:55:11 +00:00
Steinar H. Gunderson
55d44d3be6
Always register for TCP events even if there are no outstanding queries, as the other side could always close the connection, which is a valid event which should be responded to.
2007-09-28 15:53:10 +00:00
Steinar H. Gunderson
c24cd24870
Forgot to include a few hunks from ares_process.c earlier. Fixing now.
2007-09-28 15:51:00 +00:00
Steinar H. Gunderson
56ffdcefe1
Support a few more socket options, and refactor the option setting a bit. (Patch from the Google tree.)
2007-09-28 15:15:39 +00:00
Steinar H. Gunderson
50ba81cd23
Make the query callbacks return the number of timeouts that happened during the execution of a query, and update documentation accordingly. (Patch from the Google tree.)
2007-09-28 14:46:51 +00:00
Steinar H. Gunderson
b669e17544
Three fixes in one commit (sorry): a) Take care of the tcpbuf if it ends 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-28 14:28:14 +00:00
Steinar H. Gunderson
a6a159dcad
Don't skip a server if it's the only one. (Bugfix from the Google tree.)
2007-09-28 14:26:11 +00:00