From 204544298b84ffd47984936d54e725c98274664c Mon Sep 17 00:00:00 2001 From: Jan Vidar Krey Date: Thu, 16 Oct 2014 23:13:26 +0200 Subject: [PATCH] Cleanup debug logging. --- src/network/openssl.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/network/openssl.c b/src/network/openssl.c index 1db60e9..f7bc98a 100644 --- a/src/network/openssl.c +++ b/src/network/openssl.c @@ -52,6 +52,7 @@ static struct net_ssl_openssl* get_handle(struct net_connection* con) return (struct net_ssl_openssl*) con->ssl; } +#ifdef DEBUG static const char* get_state_str(enum ssl_state state) { switch (state) @@ -66,10 +67,11 @@ static const char* get_state_str(enum ssl_state state) uhub_assert(!"This should not happen - invalid state!"); return "(UNKNOWN STATE)"; } +#endif static void net_ssl_set_state(struct net_ssl_openssl* handle, enum ssl_state new_state) { - LOG_ERROR("net_ssl_set_state(): prev_state=%s, new_state=%s", get_state_str(handle->state), get_state_str(new_state)); + LOG_DEBUG("net_ssl_set_state(): prev_state=%s, new_state=%s", get_state_str(handle->state), get_state_str(new_state)); handle->state = new_state; } @@ -255,8 +257,6 @@ static int handle_openssl_error(struct net_connection* con, int ret, int read) return -2; } - LOG_ERROR("WTF?: err=%d, ret=%d", err, ret); - return -2; } @@ -433,12 +433,12 @@ void net_ssl_callback(struct net_connection* con, int events) if (ret > 0) { - LOG_ERROR("%p SSL connected!", con); + LOG_DEBUG("%p SSL connected!", con); con->callback(con, NET_EVENT_READ, con->ptr); } else { - LOG_ERROR("%p SSL handshake failed!"); + LOG_DEBUG("%p SSL handshake failed!", con); con->callback(con, NET_EVENT_ERROR, con->ptr); } break;