aboutsummaryrefslogtreecommitdiff
path: root/lib/hostip.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2004-03-09 21:42:43 +0000
committerDaniel Stenberg <daniel@haxx.se>2004-03-09 21:42:43 +0000
commit52d85341aea6bd4b6eb04f743d01a1daefeb7b55 (patch)
treebef3e29ad998658f118c2dce8ea2ea5a7b68bf50 /lib/hostip.c
parent7b2869338d344a89e69d6a41bae185cbf4804181 (diff)
only build with the windows threading trace code if
DEBUG_THREADING_GETHOSTBYNAME is defined
Diffstat (limited to 'lib/hostip.c')
-rw-r--r--lib/hostip.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/hostip.c b/lib/hostip.c
index 90a9f4fe6..8705cd515 100644
--- a/lib/hostip.c
+++ b/lib/hostip.c
@@ -98,10 +98,16 @@ static struct hostent* pack_hostent(char** buf, struct hostent* orig);
#endif
#ifdef USE_THREADING_GETHOSTBYNAME
+#ifdef DEBUG_THREADING_GETHOSTBYNAME
+/* If this is defined, provide tracing */
#define TRACE(args) \
do { trace_it("%u: ", __LINE__); trace_it args; } while (0)
static void trace_it (const char *fmt, ...);
+#else
+#define TRACE(x)
+#endif
+
static struct hostent* pack_hostent (char** buf, struct hostent* orig);
static bool init_gethostbyname_thread (struct connectdata *conn,
const char *hostname, int port);
@@ -1166,20 +1172,22 @@ static Curl_addrinfo *my_getaddrinfo(struct connectdata *conn,
#if defined(USE_THREADING_GETHOSTBYNAME)
+#ifdef DEBUG_THREADING_GETHOSTBYNAME
static void trace_it (const char *fmt, ...)
{
static int do_trace = -1;
va_list args;
if (do_trace == -1)
- do_trace = getenv("CURL_TRACE") ? 1 : 0;
+ do_trace = getenv("CURL_TRACE") ? 1 : 0;
if (!do_trace)
- return;
+ return;
va_start (args, fmt);
vfprintf (stderr, fmt, args);
fflush (stderr);
va_end (args);
}
+#endif
/* For builds without ARES/USE_IPV6, create a resolver thread and wait on it.
*/