summaryrefslogtreecommitdiff
path: root/ares_init.c
diff options
context:
space:
mode:
authorGisle Vanem <gvanem@broadpark.no>2006-07-22 14:51:39 +0000
committerGisle Vanem <gvanem@broadpark.no>2006-07-22 14:51:39 +0000
commita5c01eed75c3bdc7f6a56965abecc433c9658c5d (patch)
tree8d39cfd2085b4b4e8c706738374ed598859db865 /ares_init.c
parentfb7987171cb42ac0f9397135d6ee72bdf50c03a9 (diff)
downloadc-ares-a5c01eed75c3bdc7f6a56965abecc433c9658c5d.tar.gz
c-ares-a5c01eed75c3bdc7f6a56965abecc433c9658c5d.tar.bz2
c-ares-a5c01eed75c3bdc7f6a56965abecc433c9658c5d.zip
If CURLDEBUG defined, call curl_memdebug() if $CARES_MEMDEBUG is set.
Diffstat (limited to 'ares_init.c')
-rw-r--r--ares_init.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/ares_init.c b/ares_init.c
index 2f320a2..b26a434 100644
--- a/ares_init.c
+++ b/ares_init.c
@@ -93,6 +93,16 @@ int ares_init_options(ares_channel *channelptr, struct ares_options *options,
struct server_state *server;
struct timeval tv;
+#ifdef CURLDEBUG
+ const char *env = getenv("CARES_MEMDEBUG");
+
+ if (env)
+ curl_memdebug(env);
+ env = getenv("CARES_MEMLIMIT");
+ if (env)
+ curl_memlimit(atoi(env));
+#endif
+
channel = malloc(sizeof(struct ares_channeldata));
if (!channel)
return ARES_ENOMEM;