Commit Graph

96 Commits

Author SHA1 Message Date
Carsten Larsen 2811e30d49 Release 1.12.0 2017-04-12 01:21:06 +02:00
Carsten Sonne Larsen 742f56907a AmigaOS changes 2016-03-05 09:59:40 +01:00
Andrew Ayer 11e37a92ef Add ares_set_socket_configure_callback()
This function sets a callback that is invoked after the socket is
created, but before the connection is established.  This is an ideal
time to customize various socket options.
2016-02-09 10:05:04 -08:00
Fedor Indutny 53c2186e18 txt: introduce `ares_parse_txt_reply_ext`
Introduce `ares_txt_ext` structure with an extra `record_start`
field, which indicates a start of a new TXT record, thus allowing to
differentiate the chunks in the same record, from a chunks in a
different record.

Introduce a new API method: `ares_parse_txt_reply_ext` that works with
this kind of struct.
2016-02-04 10:00:59 +00:00
David Drysdale 7972adc5d7 api: Add entrypoints to allow use of per-server ports
Add user-visible entrypoints ares_{get,set}_servers_ports(3), which
take struct ares_addr_port_node rather than struct ares_addr_node.
This structure includes a UDP and TCP port number; if this is set
to zero, the channel-wide port values are used as before.

Similarly, add a new ares_set_servers_ports_csv(3) entrypoint, which
is analogous to ares_set_servers(3) except it doesn't ignore any
specified port information; instead, any per-server specified port
is used as both the UDP and TCP port for that server.

The internal struct ares_addr is extended to hold the UDP/TCP ports,
stored in network order, with the convention that a value of zero
indicates that the channel-wide UDP/TCP port should be used.

For the internal implementation of ares_dup(3), shift to use the
_ports() version of the get/set functions, so port information is
transferred correctly to the new channel.

Update manpages, and add missing ares_set_servers_csv to the lists
while we're at it
2016-02-02 10:13:46 +00:00
David Drysdale 06d0f72e54 api: Add ares_set_sortlist(3) entrypoint
Allow explicit configuration of the channel's sortlist, by
specifying a string in the same format as the equivalent
/etc/resolv.conf option.

This allows library users to perform the same configuration
that is available via /etc/resolv.conf, but without needing
to change that file.
2016-02-02 10:05:07 +00:00
David Drysdale f1bcfa1122 api: Allow injection of user-specified malloc/free functions
Add a new ares_library_init_mem() initialization function for the
library which allows the library user to specify their own malloc,
realloc & free equivalents for use library-wide.

Store these function pointers in library-wide global variables,
defaulting to libc's malloc(), realloc() and free().

Change all calls to malloc, realloc and free to use the function pointer
instead.  Also ensure that ares_strdup() is always available
(even if the local environment includes strdup(3)), and change the
library code to always use it.

Convert calls to calloc() to use ares_malloc() + memset
2016-02-02 10:05:07 +00:00
David Drysdale b619d13693 api: Expose the ares_library_initialized() function 2016-02-02 10:05:07 +00:00
Yang Tse 127d4cb357 ares.h: stricter CARES_EXTERN linkage decorations logic
No API change involved.
2013-03-10 21:28:35 +01:00
Daniel Stenberg 57203b14df ares.h: there is no ares_free_soa function 2013-03-09 16:48:28 +01:00
Daniel Stenberg ecf6f65b43 ares.h: s/socklen_t/ares_socklen_t for portability 2013-02-19 13:00:36 +01:00
Daniel Stenberg cf7ad9758d ares_inet_pton/ntop: cleanup
Make sure that the symbols are always exported and present in c-ares.

Make the headers prefixed with 'ares'.

Removed the inet_ntop.h version as it no longer features any content.
2013-02-17 17:44:02 +01:00
hpopescu@ixiacom.com 90364defb0 Added new feature (rfc2671) 2012-08-17 00:54:47 +02:00
Marko Kreen 979bf951d3 SOA parser added
I need to do SOA queries, so here is a parser for them.

- ares_soa_reply: new struct
- ares_malloc_data/ares_free_soa: ARES_DATATYPE_SOA_REPLY
- ares_parse_soa_reply: actual function
2012-06-15 13:32:48 +02:00
Guenter Knauf 7d3f341156 Check for __ANDROID__ in addition to ANDROID macro. 2012-04-16 10:34:05 +02:00
Guenter Knauf 4ef145cede Fix for Android to include sys/select.h for fd_set. 2012-04-14 12:27:08 +02:00
saghul 6bab0393c4 Added support for parsing NAPTR records 2012-02-23 23:15:07 +01:00
Yang Tse d81cae7a67 Windows CE specific adjustment
All versions of Windows CE support Winsock 1.1
2011-03-22 14:28:47 +01:00
Guenter Knauf 28ff9336d5 Replaced uint32_t with unsigned int to fix broken builds on a couple of platforms. 2010-07-29 23:27:46 +02:00
Ben Greear 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
Jérémy Lal 63918fca76 added ares_parse_mx_reply 2010-04-18 00:29:26 +02:00
Daniel Stenberg 63627fa5ab remove all $Id$ lines 2010-03-27 19:42:02 +01:00
Yang Tse 907b09ccd0 fix compiler warning 2010-03-11 18:53:42 +00:00
Yang Tse 8fe746fcf2 Added IPv6 name servers support 2010-03-05 20:01:47 +00:00
Yang Tse 612a29311a Daniel wants upcoming release to be 1.7.0 2009-11-23 12:03:32 +00:00
Yang Tse 36b26039ac - Jakub Hrozek renamed addrttl and addr6ttl structs to ares_addrttl and
ares_addr6ttl in order to prevent name space pollution, along with
  necessary changes to code base and man pages.This change does not break
  ABI, there is no need to recompile existing applications. But existing
  applications using these structs with the old name will need source code
  adjustments when recompiled using c-ares 1.6.1.
2009-11-23 01:24:17 +00:00
Yang Tse 7a7befd37b Add missing external API decoration for ares_set_socket_callback() 2009-11-20 14:11:06 +00:00
Yang Tse 5d62fe703f Jakub Hrozek modified ares_parse_srv_reply() and ares_parse_txt_reply() API
to return a linked lists of results. These were also modified to internally
use the ares_data memory struct and as such its result must be free'ed with
ares_free_data().
2009-11-20 09:06:33 +00:00
Yang Tse 2a916ce6e5 Initial support for the generic ares_free_data() function that will allow
applications to free memory allocated and returned by some c-ares funtions.
2009-11-20 08:50:03 +00:00
Yang Tse f77839ed17 Symbol hiding configure options renamed to the hopefully less ambiguous
--enable-symbol-hiding and --disable-symbol-hiding as well as related
macro names and some internal variables used for them.

Related configuration file preprocessor symbols named to
CARES_SYMBOL_HIDING and CARES_SYMBOL_SCOPE_EXTERN.
2009-10-31 04:16:40 +00:00
Yang Tse cef06973a2 In no particular order, changed/fixed all of the following in
ares_parse_txt_reply() current version:

- Fixed a couple of potential double free's.

- Fixed memory leaks upon out of memory condition.

- Fixed pointer arithmetic.

- Setting ntxtreply to zero upon entry for all failure cases.

- Changed data type to size_t for variables substr_len, str_len and
  the length member of ares_txt_reply struct.

- Avoided a couple of memcpy() calls.

- Changed i data type to unsigned int to prevent compiler warnings.

- Adjusted a comment.

- Use ARES_SUCCESS literal for successfull completion.

- Added CVS Id tag.
2009-10-30 16:21:56 +00:00
Daniel Stenberg 9cbd5ed034 Jakub Hrozek added ares_parse_txt_reply() for TXT parsing 2009-10-29 08:59:40 +00:00
Daniel Stenberg 9ff3cb7411 use 'ares_srv_reply' for proper name-spacing 2009-10-29 08:50:34 +00:00
Yang Tse de18bf7562 External API function linkage decoration adjustment 2009-10-29 01:02:54 +00:00
Yang Tse 9cac6a4625 Initial step towards the ability to reduce c-ares exported symbols
based on the 'visibility' attribute for GNUC and __global for Sun
compilers, taking also in account __declspec function decoration
for Win32 and Symbian DLL's.

Introducing configure options --enable-hidden-symbols and
--disable-hidden-symbols following libcurl's naming.
2009-10-28 19:45:26 +00:00
Yang Tse b53526b1a9 John Engelhart noticed an unreleased problem relative to a duplicate
ARES_ECANCELLED error code value and missing error code description.
2009-10-23 15:49:05 +00:00
Gunter Knauf 091393e79c changed u_int16_t to unsigned short because it is the only place within ares and curl where such a type would be used;
also it broke many autobuilds. We should probably introduce an ares_port_t if we want to use a type here.
2009-09-05 15:12:30 +00:00
Daniel Stenberg a5b204dd5b - Jakub Hrozek added ares_parse_srv_reply() for SRV parsing 2009-09-04 21:56:14 +00:00
Daniel Stenberg 408df8efcd - Timo Teras changed the reason code used in the resolve callback done when
ares_cancel() is used, to be ARES_ECANCELLED instead of ARES_ETIMEOUT to
  better allow the callback to know what's happening.
2009-08-03 11:51:06 +00:00
Yang Tse cf3301f024 Make ares_init(), ares_dup() and ares_init_options() return ARES_ENOTINITIALIZED
if library initialization has not been performed calling ares_library_init().
2009-05-26 18:00:14 +00:00
Yang Tse d3f3189860 Fix case 2009-05-19 15:19:03 +00:00
Yang Tse 757642f675 Remove run-time requirement for advapi32.dll since
c-ares can work even with no advapi32.dll at all.
2009-05-18 15:49:32 +00:00
Yang Tse b677ff3d15 Intentionally avoid checking if the address of SystemFunction036, a.k.a.
RtlGenRandom, has been located or not. This function is only available on
WinXP and later. When unavailable c-ares uses portable rand() function.
2009-05-18 01:25:20 +00:00
Yang Tse 5b17412c1f - Provide in external interface preprocessor symbol definitions for
CARES_HAVE_ARES_LIBRARY_INIT and CARES_HAVE_ARES_LIBRARY_CLEANUP
  to ease the use of new capabilities.

- Move ares_version() prototype to ares.h
2009-05-18 00:21:02 +00:00
Yang Tse b7c7bab713 Introduction of ares_library_init() and ares_library_cleanup() 2009-05-17 17:11:28 +00:00
Yang Tse 3a55bbebf1 Use build-time configured ares_socklen_t instead of socklen_t 2009-05-02 02:36:47 +00:00
Yang Tse 5fc305a0ba Initial step towards a configure time ares_socklen_t definition 2009-04-28 16:47:33 +00:00
Daniel Stenberg 28531dea2e - ares.h no longer uses the HAVE_STRUCT_IN6_ADDR define check, but instead it
now declares the private struct ares_in6_addr for all systems instead of
  relying on one possibly not present in the system.
2009-01-14 13:08:50 +00:00
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().
2008-12-04 12:53:03 +00:00
Dan Fandrich 20e7876430 Bring the sys/include.h include test in line with curl's. 2008-12-04 07:18:13 +00:00