aboutsummaryrefslogtreecommitdiff
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
commit655ec6bf8e440725bd1cc931d4ef4ab66601704d (patch)
treeb64f744f29ae9b0664f098a605d60950940cc252
parentc4ad533300b5771b8b4885c51c3b0d3e0d59ef5c (diff)
If CURLDEBUG defined, call curl_memdebug() if $CARES_MEMDEBUG is set.
-rw-r--r--ares/ares_init.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/ares/ares_init.c b/ares/ares_init.c
index 2f320a2fa..b26a4340d 100644
--- a/ares/ares_init.c
+++ b/ares/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;