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
9 years ago
Patrick Valsecchi
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
12 years ago
Yang Tse
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
12 years ago
Yang Tse
a1035276c1
Header inclusion clean-up
...
Remove header inclusions already done in setup_once.h
12 years ago
Yang Tse
1089cf6052
ares_dns.h: adjust DNS__16BIT and DNS__32BIT macro definitions
...
Fixing compiler warnings existing definitions triggered on these.
13 years ago
Daniel Stenberg
d0c3cb6840
ares_parse_srv_reply: silence compiler warnings
...
... by adding ugly typecasts.
13 years ago
Daniel Stenberg
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.
14 years ago
Daniel Stenberg
63627fa5ab
remove all $Id$ lines
15 years ago
Yang Tse
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.
15 years ago
Yang Tse
f2cdd32a4f
Remove typecast
15 years ago
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().
15 years ago
Yang Tse
a82a8fbf82
Renamed c-ares setup.h to ares_setup.h
15 years ago
Yang Tse
ad0b952b58
Add CVS Id tag.
15 years ago
Daniel Stenberg
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!
15 years ago
Daniel Stenberg
9ff3cb7411
use 'ares_srv_reply' for proper name-spacing
15 years ago
Yang Tse
4cc09c0216
T_SRV portability check
15 years ago
Gunter Knauf
d2f5bde0db
changed includes to match style how we do with all other *.c files.
15 years ago
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.
15 years ago
Gisle Vanem
6616621ffe
Replace 'uint16_t' with 'u_int16_t' since the latter is used in ares.h.
15 years ago
Daniel Stenberg
a5b204dd5b
- Jakub Hrozek added ares_parse_srv_reply() for SRV parsing
15 years ago