366cd6d54d
advance_tcp_send_queue: avoid NULL ptr dereference
...
If given a too large 'num_bytes' value, it would cause a NULL ptr
dereference. Instead the code will now break out of the loop at the end
of the list.
2010-12-27 13:10:48 +01:00
10ae9e4ec2
Fix GCC 4 compiler warning 'dereferencing type-punned pointer might break strict-aliasing rules'.
2010-11-14 04:42:10 +01:00
4ab5eb6631
Revert commit 494274e653
2010-11-13 14:06:44 +01:00
494274e653
Fix GCC 4 compiler warning 'dereferencing type-punned pointer might break strict-aliasing rules'.
2010-11-12 19:00:29 +01:00
747981be8e
Revert following commits:
...
07bc7ea795
3392a50ea3
9912637d32
The purpose of the whole patch was to silence a compiler warning triggered
with GCC 4 on file ares_process.c The specific compiler warning was
'dereferencing type-punned pointer might break strict-aliasing rules'.
A simpler patch will follow to equally silence the warning.
2010-11-12 18:53:58 +01:00
9912637d32
sock-addr-storage: Detect and deal with lack of .ss_family member.
...
AIX, at least, does not have sockaddr_storage.ss_family member.
Detect this in the configure logic and use proper #ifdefs in the
ares_process logic.
Signed-off-by: Ben Greear <greearb@candelatech.com >
Tested-by: Tor Arntsen <tor@spacetec.no >
2010-08-04 07:42:01 -07:00
3392a50ea3
typo: Fix compile bug for platforms that don't have sockaddr_storage.
...
Bug was introduced by me in previous commit.
Signed-off-by: Ben Greear <greearb@candelatech.com >
2010-07-31 12:21:08 -07:00
07bc7ea795
Fix aliasing warning in gcc 4.4.4 (at least).
...
Should be no functional change, though the code gets a bit
ugglier.
Signed-off-by: Ben Greear <greearb@candelatech.com >
2010-07-31 07:11:27 -07:00
3e33e2c2ba
ipv6: Fix some build issues related to the local-bind feature.
...
Signed-off-by: Ben Greear <greearb@candelatech.com >
2010-07-29 22:31:56 -07:00
e3b04e5a47
local-bind: Support binding to local interface/IPs
...
Add 3 new functions to set the local binding for the out-going
socket connection, and add ares_set_servers_csv() to set a
list of servers at once as a comma-separated string.
Signed-off-by: Ben Greear <greearb@candelatech.com >
2010-07-18 23:58:39 +02:00
63627fa5ab
remove all $Id$ lines
2010-03-27 19:42:02 +01:00
a83d892bb2
Fix a couple of typos and grammar nits.
2010-03-25 13:00:17 +01:00
8fe746fcf2
Added IPv6 name servers support
2010-03-05 20:01:47 +00:00
8b6f71ce95
- Tommie Gannert pointed out a silly bug in ares_process_fd() since it didn't
...
check for broken connections like ares_process() did. Based on that, I
merged the two functions into a single generic one with two front-ends.
2010-01-28 22:03:48 +00:00
58d9b0c1bd
- Fix configure_socket() to use ares_socket_t instead of int data type.
2009-12-29 02:04:17 +00:00
10461d1414
Make usage of calloc()'s arguments consistent with rest of code base
2009-11-18 10:33:54 +00:00
a82a8fbf82
Renamed c-ares setup.h to ares_setup.h
2009-11-02 11:55:53 +00:00
f34c2a879b
sclose() function-like macro definition used to close a socket,
...
now solely based on HAVE_CLOSESOCKET and HAVE_CLOSESOCKET_CAMEL
config file preprocessor definitions.
2009-06-19 00:41:03 +00:00
3a55bbebf1
Use build-time configured ares_socklen_t instead of socklen_t
2009-05-02 02:36:47 +00:00
737707bf4b
fix compiler warning: implicit conversion shortens 64-bit value into a 32-bit value
2009-04-14 12:53:53 +00:00
977de8c778
- ares__send_query() now varies the retry timeout pseudo-randomly to avoid
...
packet storms when several queries were started at the same time.
2009-01-13 11:51:04 +00:00
f61fa37f40
Gregor Jasny provided the patch that introduces ares_set_socket_callback(),
...
and I edited it to also get duped by ares_dup().
2008-12-04 12:53:03 +00:00
36a6a6e175
Only set TCP_NODELAY when it exists
2008-11-28 22:07:40 +00:00
65cafbe109
Refactor configure script detection of functions used to set sockets into
...
non-blocking mode, and decouple function detection from function capability.
2008-11-13 18:56:56 +00:00
1a1b4eb4f2
- Carlo Contavalli added support for the glibc "rotate" option, as documented
...
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-11-01 18:35:19 +00:00
64c82d0853
Charles Hardin patch:
...
- handles the EINPROGRESS for UDP connects
- uses closesocket instead of close on some paths that were noticed
2008-10-21 01:58:23 +00:00
f214b583f5
adjust inclusion of "nameser.h"
2008-09-17 01:02:57 +00:00
c035f2d3a4
Functionality only possible if recvfrom() is available.
2008-08-26 03:08:27 +00:00
09d10cb5c5
Brad House's validation that DNS response address matches the request address
2008-08-25 03:34:50 +00:00
2265b9281c
fix compiler warning
2008-07-10 08:21:48 +00:00
7cb1c3a215
millisecond resolution support followup
2008-05-15 22:57:33 +00:00
46dbd9461a
- Introducing millisecond resolution support for the timeout option. See
...
ares_init_options()'s ARES_OPT_TIMEOUTMS.
2008-05-13 20:48:48 +00:00
7829b79768
check for strings.h in configure and use it for the strcasecmp() proto
2008-05-08 22:11:38 +00:00
3bac381e3f
Renamed internal function to avoid a variable shadowing it
2007-10-18 17:17:18 +00:00
6ff970c067
'FD_CLOXEC' is meaningless on MSDOS/Watt-32.
2007-10-08 14:38:51 +00:00
f75d1172f8
Removed a piece of redundant code (process_answer already takes care of it).
2007-10-04 08:12:12 +00:00
10df4bdba2
Fix compiler warning
2007-09-30 19:43:23 +00:00
68aa62d76b
check availability of <netinet/tcp.h>
2007-09-30 02:12:11 +00:00
60519063ea
Use ISDIGIT instead of isdigit; fixes a gcc warning.
2007-09-29 21:57:05 +00:00
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
053ffe405d
Fix compiler warning in setsockopt().
2007-09-29 14:34:59 +00:00
13d4d28e11
TCP queries can time out too, not just UDP queries. (Patch from the Google tree.)
2007-09-29 14:25:14 +00:00
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
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
c24cd24870
Forgot to include a few hunks from ares_process.c earlier. Fixing now.
2007-09-28 15:51:00 +00:00
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
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
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
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
c97d91e349
wrong, revert the previous "fix" and instead check that the fd_set pointer
...
is non-NULL before we FD_CLR
2007-09-27 12:04:56 +00:00