Daniel Stenberg
f61fa37f40
Gregor Jasny provided the patch that introduces ares_set_socket_callback(),
...
and I edited it to also get duped by ares_dup().
16 years ago
Dan Fandrich
36a6a6e175
Only set TCP_NODELAY when it exists
16 years ago
Yang Tse
65cafbe109
Refactor configure script detection of functions used to set sockets into
...
non-blocking mode, and decouple function detection from function capability.
16 years ago
Daniel Stenberg
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
16 years ago
Yang Tse
64c82d0853
Charles Hardin patch:
...
- handles the EINPROGRESS for UDP connects
- uses closesocket instead of close on some paths that were noticed
16 years ago
Yang Tse
f214b583f5
adjust inclusion of "nameser.h"
16 years ago
Yang Tse
c035f2d3a4
Functionality only possible if recvfrom() is available.
17 years ago
Yang Tse
09d10cb5c5
Brad House's validation that DNS response address matches the request address
17 years ago
Yang Tse
2265b9281c
fix compiler warning
17 years ago
Yang Tse
7cb1c3a215
millisecond resolution support followup
17 years ago
Daniel Stenberg
46dbd9461a
- Introducing millisecond resolution support for the timeout option. See
...
ares_init_options()'s ARES_OPT_TIMEOUTMS.
17 years ago
Daniel Stenberg
7829b79768
check for strings.h in configure and use it for the strcasecmp() proto
17 years ago
Yang Tse
3bac381e3f
Renamed internal function to avoid a variable shadowing it
17 years ago
Gisle Vanem
6ff970c067
'FD_CLOXEC' is meaningless on MSDOS/Watt-32.
17 years ago
Steinar H. Gunderson
f75d1172f8
Removed a piece of redundant code (process_answer already takes care of it).
17 years ago
Yang Tse
10df4bdba2
Fix compiler warning
17 years ago
Yang Tse
68aa62d76b
check availability of <netinet/tcp.h>
17 years ago
Steinar H. Gunderson
60519063ea
Use ISDIGIT instead of isdigit; fixes a gcc warning.
17 years ago
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.
17 years ago
Gisle Vanem
053ffe405d
Fix compiler warning in setsockopt().
17 years ago
Steinar H. Gunderson
13d4d28e11
TCP queries can time out too, not just UDP queries. (Patch from the Google tree.)
17 years ago
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.)
17 years ago
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.)
17 years ago
Steinar H. Gunderson
c24cd24870
Forgot to include a few hunks from ares_process.c earlier. Fixing now.
17 years ago
Steinar H. Gunderson
56ffdcefe1
Support a few more socket options, and refactor the option setting a bit. (Patch from the Google tree.)
17 years ago
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.)
17 years ago
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.
17 years ago
Steinar H. Gunderson
a6a159dcad
Don't skip a server if it's the only one. (Bugfix from the Google tree.)
17 years ago
Daniel Stenberg
c97d91e349
wrong, revert the previous "fix" and instead check that the fd_set pointer
...
is non-NULL before we FD_CLR
17 years ago
Daniel Stenberg
99f15b20e8
eek, fix the conditions to return on either problem instead of requiring
...
both to occur
17 years ago
Daniel Stenberg
b17bb1bb67
Steinar H. Gunderson fixed: Correctly clear sockets from the fd_set on in
...
several functions (write_tcp_data, read_tcp_data, read_udp_packets) so that
if it fails and the socket is closed the following code doesn't try to use
the file descriptor.
17 years ago
Daniel Stenberg
eee17fc854
Steinar H. Gunderson modified c-ares to now also do to DNS retries even when
...
TCP is used since there are several edge cases where it still makes sense.
17 years ago
Daniel Stenberg
403b315a3b
Vlad Dinulescu fixed two outstanding valgrind reports
18 years ago
Daniel Stenberg
efa231bec5
Brad House fixed VS2005 compiler warnings due to time_t being 64bit.
...
He also made recent Microsoft compilers use _strdup() instead of strdup().
18 years ago
Daniel Stenberg
8c35c65fc7
added ares_process_fd() to allow applications to ask for processing on
...
specific sockets and thus avoiding select() and associated functions/macros.
This function will be used by upcoming libcurl releases for this very
reason. It also made me export the ares_socket_t type in the public ares.h
header file, since ares_process_fd() uses that type for two of the arguments.
18 years ago
Gisle Vanem
a627160041
Removed inclusion of <sys/types.h> in .c-files
...
since it's already included through "setup.h".
18 years ago
Yang Tse
915e774a42
Check for stdbool.h at configuration stage, and include it if available.
...
Check for lowercase 'bool' type at configuration stage. If not available
provide a suitable replacement with a type definition of 'unsigned char'
in setup_once.h
Move definitions of TRUE and FALSE to setup_once.h
18 years ago
Yang Tse
69fa447354
use macros ERRNO, SET_ERRNO(), SOCKERRNO and SET_SOCKERRNO() for errno handling
18 years ago
Gisle Vanem
5908d58da3
Use correct 3rd argument for ioctlsocket() under Watt-32.
18 years ago
Yang Tse
145117174e
compiler warning fix
18 years ago
Yang Tse
dd8b7df5dd
Compiler warning fix
18 years ago
Yang Tse
77ac18117c
Check for USE_WINSOCK instead of WIN32 where the check was done
...
to verify winsock API availability.
18 years ago
Daniel Stenberg
1bec3073dc
Brad Spencer did
...
o made ares_version.h use extern "C" for c++ compilers
o fixed compiler warnings in ares_getnameinfo.c
o fixed a buffer position init for TCP reads
19 years ago
Yang Tse
cf64c31aac
Fix compiler warnings.
19 years ago
Yang Tse
283737c856
Replace send() and recv() with swrite() and sread() macros.
19 years ago
Gisle Vanem
0a83c1e416
2nd try adding CVS id.
19 years ago
Yang Tse
fb7987171c
Fix compiler warning
19 years ago
William Ahern
70dbc3725d
Handle EAGAIN/EWOULDBLOCK readiness errors, which can occur for both TCP and
...
UDP even when a poll(2) or select(2) suggest otherwise.
19 years ago
Daniel Stenberg
22e34b53e4
Nick Mathewson added the ARES_OPT_SOCK_STATE_CB option that when set makes
...
c-ares call a callback on socket state changes. A better way than the
ares_getsock() to get full control over the socket state.
19 years ago
Gisle Vanem
ac9950c3eb
Changes for PellesC for Win32. It needs <unistd.h> for 'ssize_t'. Hence the
...
rearrangement in ares_process.c.
19 years ago