Commit Graph

794 Commits

Author SHA1 Message Date
Yang Tse 7358db5c27 minor change for wince-cegcc and wince-mingw32ce support 2008-05-17 01:20:56 +00:00
Yang Tse 164a985115 millisecond resolution support followup 2008-05-15 22:57:33 +00:00
Gisle Vanem 8aabd9839b Replaced "-DHAVE_FIONBIO" with "-DHAVE_IOCTLSOCKET".
Added "-DHAVE_GETTIMEOFDAY". Trimmed lines.
2008-05-15 20:47:45 +00:00
Yang Tse 882fbb0433 sync with reality 2008-05-15 10:04:15 +00:00
Yang Tse 15eee5dbbb remove compilation time generated files 2008-05-15 09:18:05 +00:00
Yang Tse cfc1d037ff use same time source for timeout initialization and processing 2008-05-15 00:00:19 +00:00
Yang Tse 2748c64d60 Improve toolchain detection for WinCE cross compilation:
When cross compiling WinCE with the arm-wince-cegcc-gcc C compiler
symbol __CEGCC__ is defined and the unix-like compatibility layer
is used. For our purposes this is not a native Windows build.

When cross compiling WinCE with the arm-wince-mingw32ce-gcc C compiler
symbol __MINGW32CE__ is defined and the unix-like compatibility layer
is not used. For our purposes this _is_ a native Windows build.
2008-05-14 19:42:17 +00:00
Yang Tse 5e06ec8409 skip checks for Windows specific header files
when build target is not a native Windows one
2008-05-14 16:14:35 +00:00
Yang Tse 04d0a84ae5 WinCE cross compilation adjustments:
HAVE_WINSOCK2_H shall not be defined.
HAVE_WS2TCPIP_H shall not be defined.
2008-05-14 13:54:36 +00:00
Daniel Stenberg 76c251513e - Introducing millisecond resolution support for the timeout option. See
ares_init_options()'s ARES_OPT_TIMEOUTMS.
2008-05-13 20:48:48 +00:00
Yang Tse 80afddacc8 also ignore this 2008-05-13 18:27:18 +00:00
Yang Tse 83fb13329d also ignore this 2008-05-13 17:23:01 +00:00
Yang Tse e06c923605 ignore this compilation time generated files 2008-05-13 17:11:16 +00:00
Yang Tse ab1169895f don't keep in CVS this compilation time generated file 2008-05-13 17:03:28 +00:00
Yang Tse 01e81c7e10 add MSVC6 project for acountry sample program 2008-05-13 15:37:49 +00:00
Yang Tse 7bf1142ae0 update MSVC6 projects to use the multithreaded DLL runtime library 2008-05-13 15:34:22 +00:00
Yang Tse af9f7a952b add MSVC6 project for acountry sample program 2008-05-13 15:31:19 +00:00
Yang Tse d72efff878 skip libtool C++ preprocessor compiler and linker checks 2008-05-12 15:02:51 +00:00
Yang Tse e4c60e2030 ignore libcares.pc 2008-05-12 12:22:23 +00:00
Yang Tse ed80eb5b0f configure script will now define HAVE_CLOCK_GETTIME_MONOTONIC symbol only
when function clock_gettime() is available and the monotonic timer is
also available. Otherwise, in some cases, librt or libposix4 could be used
for linking even when finally not using the clock_gettime() function due
to lack of the monotonic clock.
2008-05-12 02:04:21 +00:00
Yang Tse 60dd765b3d fix syntax error: missing semicolon 2008-05-10 23:50:55 +00:00
Yang Tse b380dd030f Add library checking for clock_gettime() support 2008-05-10 15:46:08 +00:00
Yang Tse d708ef6731 Use monotonic time source if available. 2008-05-09 16:30:24 +00:00
Daniel Stenberg d1238baecb Removed AC_PROG_CC_STDC again. It enforces C99/gnu99 stdandard which is too
liberal for me. Also, autoconf 2.61 and earlier doesn't work with icc 10.1
for this macro. (2.62 confirmed to work though). See discusson on the mailing
list starting here:

http://daniel.haxx.se/projects/c-ares/mail/c-ares-archive-2008-05/0001.shtml
2008-05-09 13:10:34 +00:00
Daniel Stenberg cf4570a06f include strings.h (if available) for the strcasecmp() proto 2008-05-08 22:14:17 +00:00
Daniel Stenberg 6df5dddd90 check for strings.h in configure and use it for the strcasecmp() proto 2008-05-08 22:11:38 +00:00
Daniel Stenberg ec0665a931 adjusted to work with the updated configure.ac 2008-05-07 21:27:35 +00:00
Daniel Stenberg 836fa69e2e - Sebastian made c-ares able to return all PTR-records when doing reverse
lookups. It is not common practice to have multiple PTR-Records for a single
  IP, but its perfectly legal and some sites have those.
2008-05-07 21:20:45 +00:00
Daniel Stenberg 9026dc2da4 - Doug Goldstein provided a configure patch: updates autoconf 2.13 usage to
autoconf 2.57 usage (which is the version you have specified as the minimum
  version). It's a minor change but it does clean up some warnings with newer
  autoconf (specifically 2.62).
2008-05-07 21:16:06 +00:00
Yang Tse a60c9ef88e Improved parsing of resolver configuration files 2008-05-05 17:48:25 +00:00
Yang Tse 39b689f966 make previous compiler warning fix more portable 2008-04-07 19:12:35 +00:00
Yang Tse ab8d1464a7 fix compiler warning: indirection to slightly different base types 2008-04-07 14:37:17 +00:00
Yang Tse bf90d11a31 fix compiler warning: local variable may be used without having been initialized 2008-04-07 14:20:05 +00:00
Yang Tse 74c500b6ec fix compiler warning: unreferenced formal parameter 2008-04-07 12:44:47 +00:00
Yang Tse 26aeadbc3e fix compiler warning: assignment within conditional expression 2008-04-07 12:40:05 +00:00
Daniel Stenberg 12a90289ed - Alexey Simak fixed the VC dsp file by adding the missing source file
ares_expand_string.c
2008-04-04 20:26:06 +00:00
Daniel Stenberg 592697583d Alexey Simak made adig support NAPTR records 2008-04-04 20:24:41 +00:00
Daniel Stenberg b50a96982e Eino Tuominen improved the code when a file is used to seed the randomizer 2008-04-04 20:05:23 +00:00
Yang Tse 115446be37 Force AIX xlc to fail and not generate object code if the source code has
compiled with errors. This behaviour is needed for autoconf macros which
rely on the ability to compile with or without errors, and is safer than
xlc's default of failing only upon severe errors.
2008-02-29 17:13:39 +00:00
Gunter Knauf 6cc8df95dd added get_ver.awk since c-ares is a standalone project, and should therefore also compile when cURL is absent. 2008-02-27 01:51:40 +00:00
Gunter Knauf f105e23444 a couple of small fixes to the makefile:
fixed comments; fixed INSTDIR define, simplified rules;
changed to use get_ver.awk in current dir rather than the curl one.
2008-02-27 01:43:12 +00:00
Gunter Knauf f20c94ced9 fixed linker def file for tools when compiled with gcc/nlmconv. 2008-02-16 00:21:58 +00:00
Gunter Knauf 13ebf61850 added some files which were missing in release tarballs. 2008-02-14 21:24:59 +00:00
Gunter Knauf 3620e71010 updated copyright for new year. 2008-01-17 01:20:03 +00:00
Gisle Vanem bf98b635cd Added '-d' option for Watt-32 debugging. 2008-01-02 05:30:52 +00:00
Yang Tse 07a1857d59 MSVC 9.0 (VS2008) does not support Windows build targets prior to WinXP,
and makes wrong asumptions of build target when it isn't specified. So,
if no build target has been defined we will target WinXP when building
with MSVC 9.0 (VS2008).
2007-12-18 18:08:19 +00:00
Daniel Stenberg 79ef08f631 build acountry too 2007-12-11 19:34:31 +00:00
Gisle Vanem e3c5f8374b Added acountry.c. 2007-12-11 17:26:07 +00:00
Gisle Vanem 6dc68b4193 Added build of acountry.nlm. 2007-12-11 17:24:43 +00:00
Gisle Vanem afab4d888f Added build of acountry.exe. 2007-12-11 17:23:18 +00:00
Gisle Vanem c751dfd65d Build acountry.exe. Added 'socklen_t' define. 2007-12-11 17:22:20 +00:00
Gisle Vanem dbca1347f1 Another sample application that returns country-code and
name from an IPv4-address or host-name. Using the service of
countries.nerd.dk.
2007-12-11 17:21:12 +00:00
Daniel Stenberg 3b6315ce1f grrr, the previous commit was meant to properly make sure that we don't
link any executables when doing debug builds since they kind of assume
symbols provided by libcurl, but it also wrongly included acountry.c
2007-12-10 22:20:26 +00:00
Daniel Stenberg 3c1db5f250 when building 2007-12-10 22:19:06 +00:00
Daniel Stenberg 562e9b7bf3 build ahost and adig by default but don't install them 2007-12-10 21:42:04 +00:00
Gisle Vanem bd99a7dc8c Fix for targets that do have 'struct in6_addr', but which doesn't
define 's6_addr' as a macro.
2007-12-10 16:14:02 +00:00
Yang Tse 15c304225f Fix three issues previous cleanup introduces. 2007-12-03 19:57:18 +00:00
Daniel Stenberg a1772ca406 Erik Kline cleaned up ares_gethostbyaddr.c:next_lookup() somewhat 2007-12-03 10:25:05 +00:00
Daniel Stenberg 30eda92a53 Brad Spencer fixed the configure script to assume that there's no
/dev/urandom when built cross-compiled as then the script cannot check for
it.
2007-12-03 10:22:29 +00:00
Daniel Stenberg 800a72878a the gethostbyname fix applied here as well 2007-11-28 15:18:27 +00:00
Daniel Stenberg 649f7b7fd3 fix next_lookup() to continue searching even if c-ares failed to load the
/etc/hosts file, pointed out by Erik Kline:
http://daniel.haxx.se/projects/c-ares/mail/c-ares-archive-2007-11/0027.shtml
2007-11-28 10:46:40 +00:00
Daniel Stenberg b28dc011e0 Remove the check for libdl since that isn't actually used and it causes
warnings. Pointed out by Robin Cornelius.
2007-11-27 22:41:53 +00:00
Daniel Stenberg ee4fef3768 pkgconfig fix by Andreas Schuldei 2007-11-27 22:38:11 +00:00
Daniel Stenberg 058a023fae spellfix 2007-11-27 22:37:55 +00:00
Daniel Stenberg 35212da048 and we start on 1.5.2! 2007-11-21 10:16:44 +00:00
Daniel Stenberg 755e743cdd change 2007-11-21 10:12:20 +00:00
Daniel Stenberg 1a323390ec oops 2007-11-21 10:12:06 +00:00
Daniel Stenberg 23559fd118 start working on 1.5.1 now 2007-11-21 09:31:56 +00:00
Daniel Stenberg d994a873a4 this is what 1.5.0 is 2007-11-21 09:24:03 +00:00
Daniel Stenberg 1746b57161 fill in missing copyrights 2007-11-19 15:47:01 +00:00
Gunter Knauf 5be00c95a7 removed now obsolete defines;
updated external library versions to latest.
2007-11-18 22:48:39 +00:00
Steinar H. Gunderson ea3fe98867 Fix a double free. 2007-11-16 09:36:00 +00:00
Yang Tse ca95f58ac0 Needed now that in6_addr is referenced in ares.h 2007-11-15 19:44:01 +00:00
Steinar H. Gunderson 5cf6a539fe 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 17fde12fb8 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
Yang Tse 32195c673d Define WIN32 when build target is Win32 API.
This also defines it for WinCE even though it is a subset of WIN32.
2007-11-08 18:13:54 +00:00
Yang Tse 61572a1f97 The only libraries actually needed for sample programs adig and
ahost are ws2_32.lib and advapi32.lib
2007-11-08 01:33:28 +00:00
Yang Tse dee3844f13 MSVC versions prior to VS2005 do not complain about portable C functions 2007-11-07 18:18:42 +00:00
Yang Tse 08c5e2a194 Windows build targets have socklen_t definition in ws2tcpip.h but some
versions of ws2tcpip.h do not have the definition. It seems that when
the socklen_t definition is missing from ws2tcpip.h the definition for
INET_ADDRSTRLEN is also missing, and that when one definition is present
the other one also is available.
2007-10-24 14:39:07 +00:00
Gunter Knauf f614fe4946 removed dependency on gettimeofday() since we use only 1 sec resolution here. 2007-10-22 23:31:40 +00:00
Yang Tse 5c8fc7dce9 Fix compiler warning: conversion from "int" to "unsigned short" may lose significant bits 2007-10-20 15:11:51 +00:00
Yang Tse d0fe681a28 Fix message shown when detecting icc version 2007-10-19 12:15:00 +00:00
Yang Tse 9a70a6d0c0 Avoid shadowing a global declaration 2007-10-19 10:52:28 +00:00
Yang Tse ee19b44fe0 Renamed a variable to avoid shadowing a global declaration 2007-10-18 17:31:19 +00:00
Yang Tse 8f0bef2fa0 Renamed internal function to avoid a variable shadowing it 2007-10-18 17:17:18 +00:00
Yang Tse 33ddeb6dcc Fix compiler warning: feupdateenv is not implemented and will always fail.
Specifically for linux x86-64 with Intel's icc.
2007-10-18 16:24:14 +00:00
Yang Tse e0dc7d6fc8 Sync PLATFORM_AIX_V3 detection and CURL_CC_DEBUG_OPTS()
icc warning level with libcurl's
2007-10-18 15:11:51 +00:00
Yang Tse 8cfb0e26bb Fix compiler warning: conversion from "int" to "unsigned char"
may lose significant bits
2007-10-18 01:01:20 +00:00
Yang Tse 223e470e93 actually sync with lib/setup_once.h 2007-10-17 18:18:27 +00:00
Yang Tse 582bad89ef sync with lib/setup_once.h 2007-10-17 16:59:24 +00:00
Steinar H. Gunderson 92aaff009d 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
Dan Fandrich a83b5d1b67 Mention first version with CURLOPT_COPYPOSTFIELDS.
Don't confuse NUL with NULL.
2007-10-15 21:19:40 +00:00
Gisle Vanem 3c875e0112 Added needed 'HAVE_*' defines. 2007-10-08 14:39:52 +00:00
Gisle Vanem 59136ece19 'FD_CLOXEC' is meaningless on MSDOS/Watt-32. 2007-10-08 14:38:51 +00:00
Steinar H. Gunderson 91b38857ef Removed a piece of redundant code (process_answer already takes care of it). 2007-10-04 08:12:12 +00:00
Steinar H. Gunderson 6d5f899761 Another timeout fix in ares_getnameinfo(). 2007-10-04 08:09:52 +00:00
Steinar H. Gunderson 77a3e3c7f7 Send the timeout count in ares_getnameinfo(). 2007-10-04 08:09:04 +00:00
Steinar H. Gunderson 81249965f7 Moved the NULL check for channel upwards in ares_destroy(). 2007-10-04 08:07:47 +00:00
Steinar H. Gunderson 45c6db9ac4 Clarified the comment over ares_cancel. 2007-10-04 08:06:25 +00:00
Yang Tse 94162d62ac Avoid a segfault when generating a DNS "Transaction ID" in internal
function init_id_key() under low memory conditions.
2007-10-02 18:26:48 +00:00
Yang Tse f5cad68d22 Add ares_llist.c and ares_llist.h to MSCV project file. 2007-10-02 11:13:58 +00:00
Daniel Stenberg 19c8da85d8 Fixed the problem where next_lookup would use 'status' uninitialized. Now
it gets passed the initial value as an argument.
2007-10-02 08:12:30 +00:00
Yang Tse b03abddb28 Avoid inline C99ism, and move c-ares routines for managing doubly-linked lists. 2007-10-02 02:18:01 +00:00
Daniel Stenberg ccf083e26d ares_strerror() segfaulted if the input error number was out of the currently
supported range.
2007-10-01 22:52:31 +00:00
Daniel Stenberg dbd4abf0ff Prevent ares_strerror() from segfaulting if an invalid error code is passed
in as argument!
2007-10-01 22:51:38 +00:00
Yang Tse 38dd0ede9d Fix compiler warning 2007-09-30 19:43:23 +00:00
Yang Tse 62c264bcdb check availability of <netinet/tcp.h> 2007-09-30 02:12:11 +00:00
Yang Tse d243908a01 improve portability, defining MAXDNAME and MAXCDNAME 2007-09-30 00:37:47 +00:00
Steinar H. Gunderson c145fbea49 Fix a memory leak that I recently inadvertedly introduced. 2007-09-30 00:08:01 +00:00
Steinar H. Gunderson 84fcff79f4 Use ISDIGIT instead of isdigit; fixes a gcc warning. 2007-09-29 21:57:05 +00:00
Steinar H. Gunderson 2694b970e8 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 23f5d145ec 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
Gisle Vanem b01ab65225 We should standarise on C comments. 2007-09-29 14:37:47 +00:00
Gisle Vanem 7a7f490efa Fix compiler warning in setsockopt(). 2007-09-29 14:34:59 +00:00
Steinar H. Gunderson 95c15fce0c 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 c788efffd4 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 c1a475e708 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 d0de9663e2 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 d6dd848523 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 9fc66e4dd9 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 6ecea9453b Handle the root of the DNS tree correctly in ares_expand_name. 2007-09-29 13:38:17 +00:00
Daniel Stenberg 8179743cee today's modifications by Steinar and me 2007-09-28 20:28:20 +00:00
Daniel Stenberg 3d59a3855a Bumped version to 1.5.0 for next release and soname bumped to 2 due to ABI
and API changes in the progress callback (and possibly more coming up from
Steinar)
2007-09-28 20:28:06 +00:00
Steinar H. Gunderson ef3b425b11 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 026d93b4f6 Yet more missing hunks... Nggh. 2007-09-28 15:55:11 +00:00
Steinar H. Gunderson 36710c4586 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 63ac6156aa Forgot to include a few hunks from ares_process.c earlier. Fixing now. 2007-09-28 15:51:00 +00:00
Steinar H. Gunderson 08a70d117c 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 6ce589c3ee 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 d426c20c0a 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 54ca7d8cb2 Don't skip a server if it's the only one. (Bugfix from the Google tree.) 2007-09-28 14:26:11 +00:00
Daniel Stenberg 015fc6aa17 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
Daniel Stenberg a739b9bc45 eek, fix the conditions to return on either problem instead of requiring
both to occur
2007-09-27 12:02:15 +00:00
Daniel Stenberg 0f4664d27f 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.
2007-09-22 21:23:10 +00:00
Daniel Stenberg 0f89a2e639 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.
2007-09-22 21:04:16 +00:00
Daniel Stenberg 05b26e7566 Brad House provided a fix for ares_save_options(): Apparently I overlooked
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-09-22 20:45:50 +00:00
Daniel Stenberg d460b601f9 added initial pkg-config file (attempt) 2007-07-26 21:56:47 +00:00
Gunter Knauf 37dc0fa519 added curl include for debug builds. 2007-07-20 21:50:53 +00:00
Daniel Stenberg 598c589359 added another SEE ALSO 2007-07-14 23:01:49 +00:00
Daniel Stenberg 1261c3feba Brad House's fix to hish a win32 compiler warning 2007-07-14 13:14:58 +00:00
Daniel Stenberg 7fc300d5dc added Vlad's entire description of his valgrind fix 2007-07-14 13:11:36 +00:00
Daniel Stenberg 88ce03e945 Vlad Dinulescu fixed two outstanding valgrind reports 2007-07-14 13:08:50 +00:00
Gunter Knauf 41df67fc2c added better CodeWarrior detection. 2007-07-08 23:17:56 +00:00
Gunter Knauf 932d38323f removed some obsolete include paths and defines. 2007-07-07 16:26:02 +00:00
Gunter Knauf 6606ae6fe0 add test for gettimeofday() so that HAVE_GETTIMEOFDAY gets defined. 2007-07-04 17:20:19 +00:00
Gunter Knauf 3760180320 although the check for HAVE_STRUCT_TIMEVAL solved the redefine it is incorrect; lets see if a check for HAVE_GETTIMEOFDAY also works; if gettimeofday() is present then we can assume we have the timezone struct too. 2007-07-04 10:54:15 +00:00
Gunter Knauf 056af4c9ac added check for sys/param.h. 2007-07-04 09:01:40 +00:00
Gunter Knauf 07bf3c86b6 trial to catch problem with Daniels cross-mingw ares builds. 2007-07-03 18:18:40 +00:00
Gunter Knauf 4182803bc2 added NetWare CLIB-own header to solve gcc warnings. 2007-07-03 16:21:57 +00:00
Gunter Knauf 7509ef6b4e few minor changes to make ares compile for NetWare CLIB architecture. 2007-07-03 16:00:36 +00:00