From 9656d30661433fe49e16e511f25216b207ab8501 Mon Sep 17 00:00:00 2001 From: dmiller Date: Mon, 8 Dec 2014 23:16:30 +0000 Subject: [PATCH] Don't print debug messages if not debugging This was Red Hat bug #1000770, patched downstream in RHBA-2014-0683 https://bugzilla.redhat.com/show_bug.cgi?id=1000770 --- ncat/ncat_connect.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/ncat/ncat_connect.c b/ncat/ncat_connect.c index 00255c6e7..f20554cda 100644 --- a/ncat/ncat_connect.c +++ b/ncat/ncat_connect.c @@ -417,7 +417,8 @@ static int do_proxy_http(void) goto bail; } code = http_parse_status_line_code(status_line); - logdebug("Proxy returned status code %d.\n", code); + if (o.debug) + logdebug("Proxy returned status code %d.\n", code); free(status_line); status_line = NULL; if (http_read_header(&sockbuf, &header) != 0) { @@ -458,7 +459,8 @@ static int do_proxy_http(void) http_challenge_free(&challenge); goto bail; } - logdebug("Reconnection header:\n%s", request); + if (o.debug) + logdebug("Reconnection header:\n%s", request); if (send(sd, request, n, 0) < 0) { loguser("Error sending proxy request: %s.\n", socket_strerror(socket_errno())); free(request); @@ -475,7 +477,8 @@ static int do_proxy_http(void) goto bail; } code = http_parse_status_line_code(status_line); - logdebug("Proxy returned status code %d.\n", code); + if (o.debug) + logdebug("Proxy returned status code %d.\n", code); free(status_line); status_line = NULL; if (http_read_header(&sockbuf, &header) != 0) {