#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);
#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.
*/