From 5cce57cbd8aea6ecdb233e9792973522de9daf62 Mon Sep 17 00:00:00 2001 From: Stefan Ritt Date: Wed, 5 Nov 2014 10:44:56 +0100 Subject: [PATCH] Fixed debug output --- src/elogd.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/elogd.c b/src/elogd.c index 13c619f6..58bf3134 100755 --- a/src/elogd.c +++ b/src/elogd.c @@ -28120,12 +28120,14 @@ int process_http_request(const char *request, int i_conn) return 0; if (get_verbose() < VERBOSE_DEBUG) { - strlcpy(str, request, sizeof(str)); - if (strchr(str, '\r')) - *strchr(str, '\r') = 0; - if (strchr(str, '\n')) - *strchr(str, '\n') = 0; - eputs(str); + if (get_verbose() > 0) { + strlcpy(str, request, sizeof(str)); + if (strchr(str, '\r')) + *strchr(str, '\r') = 0; + if (strchr(str, '\n')) + *strchr(str, '\n') = 0; + eputs(str); + } } else if (get_verbose() >= VERBOSE_DEBUG) { eputs("\n"); eputs(request); @@ -28680,7 +28682,8 @@ void send_return(int _sock, const char *net_buffer) send(_sock, p + 4, length, 0); #endif if (get_verbose() < VERBOSE_DEBUG) { - eprintf("Returned %d bytes\n", length); + if (get_verbose() > 0) + eprintf("Returned %d bytes\n", length); } else if (get_verbose() >= VERBOSE_DEBUG) { if (strrchr(net_buffer, '/')) strlcpy(str, strrchr(net_buffer, '/') + 1, sizeof(str)); @@ -28736,7 +28739,8 @@ void send_return(int _sock, const char *net_buffer) } if (get_verbose() < VERBOSE_DEBUG) { - eprintf("Returned %d bytes\n", return_length); + if (get_verbose() > 0) + eprintf("Returned %d bytes\n", return_length); } else if (get_verbose() == VERBOSE_DEBUG) { if (strrchr(net_buffer, '/')) strlcpy(str, strrchr(net_buffer, '/') + 1, sizeof(str));