Commit Graph

20 Commits

Author SHA1 Message Date
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 68a938e771 ares__read_line: clear buf pointer on realloc failure 2016-01-24 09:05:40 +00:00
Jakub Hrozek bba4dc573f ares__read_line: free buf on realloc failure 2014-11-06 10:21:54 +01:00
Yang Tse a1035276c1 Header inclusion clean-up
Remove header inclusions already done in setup_once.h
2012-12-14 18:25:56 +01:00
Daniel Stenberg 63627fa5ab remove all $Id$ lines 2010-03-27 19:42:02 +01:00
Yang Tse 86718e2f52 fix compiler warning 2010-02-26 16:42:33 +00:00
Yang Tse 1c5f8be38d Fix compiler warning: conditional expression is constant 2009-11-10 18:41:03 +00:00
Yang Tse a82a8fbf82 Renamed c-ares setup.h to ares_setup.h 2009-11-02 11:55:53 +00:00
Yang Tse 590e697792 Fix compiler warning 2009-10-09 14:06:38 +00:00
Yang Tse f3346ca16b Fix compiler warning 2009-10-08 18:38:29 +00:00
Gisle Vanem 0a83c1e416 2nd try adding CVS id. 2006-07-22 15:37:10 +00:00
Gisle Vanem f6e7395ca0 Added CVS id. 2006-07-22 15:21:13 +00:00
Gisle Vanem e2bdd6b5a6 Fix PellesC warning. 2005-12-20 20:58:51 +00:00
Daniel Stenberg 3e748f4b50 removed tabs and trailing whitespace from source 2004-10-06 07:50:18 +00:00
Daniel Stenberg d5f3636a52 - Fixed a few variable return types for some system calls. Made configure
check for ssize_t to make it possible to use that when receiving the send()
  error code. This is necessary to prevent compiler warnings on some systems.

- Made configure create config.h, and all source files now include setup.h that
  might include the proper config.h (or a handicrafted alternative).

- Switched to 'ares_socket_t' type for sockets in ares, since Windows don't
  use 'int' for that.

- automake-ified and libool-ified c-ares. Now it builds libcares as a shared
  lib on most platforms if wanted. (This bloated the size of the release
  archive with another 200K!)

- Makefile.am now uses Makefile.inc for the c sources, h headers and man
  pages, to make it easier for other makefiles to use the exact same set of
  files.

- Adjusted 'maketgz' to use the new automake magic when building distribution
  archives.
2004-07-22 22:18:45 +00:00
Daniel Stenberg 401e862bf6 attempted typecase to silence the MIPSpro warning:
cc-1506 cc: REMARK File = ../../curl/ares/ares__read_line.c, Line = 46
There is an implicit conversion from "unsigned long" to "int"; rounding, sign
extension, or loss of accuracy may result.

if (!fgets(*buf + offset, *bufsize - offset, fp))
2004-03-03 13:03:35 +00:00
Daniel Stenberg 02ffff0b00 don't mix int and size_t, it generates warnings! 2004-02-26 12:45:29 +00:00
Daniel Stenberg 3f0b19ea45 strlen() returns a size_t, which might be larger than int on some platforms 2004-02-23 07:46:59 +00:00
Daniel Stenberg 3d0a7c00df remove rcsid stuff from c files, it serves no useful purpose 2004-02-02 15:59:35 +00:00
Daniel Stenberg 5e847a14bd ares 1.1.1 with collected applied patches 2003-10-07 21:54:04 +00:00