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
148c8e0353
protocol parsing: check input data stricter
...
... so that bad length fields aren't blindly accepted
Bug: http://c-ares.haxx.se/mail/c-ares-archive-2013-04/0016.shtml
2013-04-15 22:28:01 +02:00
0c677f578e
setup_once.h: refactor inclusion of <unistd.h> and <sys/socket.h>
...
Inclusion of these two header files now done in setup_once.h
2012-12-14 18:36:59 +01:00
a1035276c1
Header inclusion clean-up
...
Remove header inclusions already done in setup_once.h
2012-12-14 18:25:56 +01:00
1089cf6052
ares_dns.h: adjust DNS__16BIT and DNS__32BIT macro definitions
...
Fixing compiler warnings existing definitions triggered on these.
2011-08-21 19:18:53 +02:00
d0c3cb6840
ares_parse_srv_reply: silence compiler warnings
...
... by adding ugly typecasts.
2011-08-21 15:43:36 +02:00
2d5ed6400b
cleanup: avoid unsafe typecasts
...
Avoid the risk of reading 16bit data from an unaligned address by using
a macro that is adapted for this.
2010-12-18 22:20:16 +01:00
63627fa5ab
remove all $Id$ lines
2010-03-27 19:42:02 +01:00
57e48c4cf1
- Larry Lansing fixed ares_parse_srv_reply to properly parse replies
...
which might contain non-SRV answers, skipping over potential non-SRV
ones such as CNAMEs.
2009-11-26 01:21:21 +00:00
f2cdd32a4f
Remove typecast
2009-11-20 09:57:25 +00:00
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
a82a8fbf82
Renamed c-ares setup.h to ares_setup.h
2009-11-02 11:55:53 +00:00
ad0b952b58
Add CVS Id tag.
2009-10-30 18:03:04 +00:00
df2dc91fd4
no need to check for NULL pointers before dereferencing, as the pointers
...
MUST be valid and they are dereferenced further down in the function
unconditionally!
2009-10-29 09:12:40 +00:00
9ff3cb7411
use 'ares_srv_reply' for proper name-spacing
2009-10-29 08:50:34 +00:00
4cc09c0216
T_SRV portability check
2009-09-06 23:46:07 +00:00
d2f5bde0db
changed includes to match style how we do with all other *.c files.
2009-09-05 20:11:32 +00:00
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
6616621ffe
Replace 'uint16_t' with 'u_int16_t' since the latter is used in ares.h.
2009-09-05 12:33:08 +00:00
a5b204dd5b
- Jakub Hrozek added ares_parse_srv_reply() for SRV parsing
2009-09-04 21:56:14 +00:00