From 8e8fe805c81d3edc974c12c468f793ea0c1e5ee7 Mon Sep 17 00:00:00 2001 From: Guus Sliepen Date: Thu, 11 Dec 2008 14:03:52 +0000 Subject: [PATCH] Only show meta connection related debug messages when debug level >= 4 --- src/meta.c | 10 +++++----- src/net_socket.c | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/meta.c b/src/meta.c index 524a6ce0..cb4b03e1 100644 --- a/src/meta.c +++ b/src/meta.c @@ -53,13 +53,13 @@ bool send_meta(connection_t *c, const char *buffer, int length) { return false; } - logger(LOG_DEBUG, _("Encrypted write %p %p %p %d"), c, c->buffer, outbuf, length); + ifdebug(META) logger(LOG_DEBUG, _("Encrypted write %p %p %p %d"), c, c->buffer, outbuf, length); bufferevent_write(c->buffer, (void *)outbuf, length); - logger(LOG_DEBUG, _("Done.")); + ifdebug(META) logger(LOG_DEBUG, _("Done.")); } else { - logger(LOG_DEBUG, _("Unencrypted write %p %p %p %d"), c, c->buffer, buffer, length); + ifdebug(META) logger(LOG_DEBUG, _("Unencrypted write %p %p %p %d"), c, c->buffer, buffer, length); bufferevent_write(c->buffer, (void *)buffer, length); - logger(LOG_DEBUG, _("Done.")); + ifdebug(META) logger(LOG_DEBUG, _("Done.")); } return true; @@ -115,7 +115,7 @@ bool receive_meta(connection_t *c) { inlen -= endp - bufp; bufp = endp; } else { - logger(LOG_DEBUG, _("Received encrypted %d bytes"), inlen); + ifdebug(META) logger(LOG_DEBUG, _("Received encrypted %d bytes"), inlen); evbuffer_expand(c->buffer->input, c->buffer->input->off + inlen); result = EVP_DecryptUpdate(c->inctx, (unsigned char *)c->buffer->input->buffer + c->buffer->input->off, &outlen, (unsigned char *)bufp, inlen); if(!result || outlen != inlen) { diff --git a/src/net_socket.c b/src/net_socket.c index 0b9a1324..a6fe54bc 100644 --- a/src/net_socket.c +++ b/src/net_socket.c @@ -355,7 +355,7 @@ void handle_meta_read(struct bufferevent *event, void *data) { } void handle_meta_write(struct bufferevent *event, void *data) { - logger(LOG_DEBUG, _("handle_meta_write() called")); + ifdebug(META) logger(LOG_DEBUG, _("handle_meta_write() called")); } void handle_meta_connection_error(struct bufferevent *event, short what, void *data) { -- 2.39.5