From 7988acbff4f81a85484214879c9f20d9c612f5d1 Mon Sep 17 00:00:00 2001 From: Deomid Ryabkov Date: Thu, 26 Jan 2017 12:18:50 +0000 Subject: [PATCH] Raise log level of mbedTLS socket evs to LL_DEBUG PUBLISHED_FROM=ed0ac4133342c733977e7884a6bbadab7ee74127 --- mongoose.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/mongoose.c b/mongoose.c index ebb6a517..108b13ad 100644 --- a/mongoose.c +++ b/mongoose.c @@ -4397,7 +4397,7 @@ int ssl_socket_recv(void *ctx, unsigned char *buf, size_t len); static int ssl_socket_send(void *ctx, const unsigned char *buf, size_t len) { struct mg_connection *nc = (struct mg_connection *) ctx; int n = (int) MG_SEND_FUNC(nc->sock, buf, len, 0); - DBG(("%p %d -> %d", nc, (int) len, n)); + LOG(LL_DEBUG, ("%p %d -> %d", nc, (int) len, n)); if (n >= 0) return n; n = mg_get_errno(); return ((n == EAGAIN || n == EINPROGRESS) ? MBEDTLS_ERR_SSL_WANT_WRITE : -1); @@ -4406,7 +4406,7 @@ static int ssl_socket_send(void *ctx, const unsigned char *buf, size_t len) { static int ssl_socket_recv(void *ctx, unsigned char *buf, size_t len) { struct mg_connection *nc = (struct mg_connection *) ctx; int n = (int) MG_RECV_FUNC(nc->sock, buf, len, 0); - DBG(("%p %d <- %d", nc, (int) len, n)); + LOG(LL_DEBUG, ("%p %d <- %d", nc, (int) len, n)); if (n >= 0) return n; n = mg_get_errno(); return ((n == EAGAIN || n == EINPROGRESS) ? MBEDTLS_ERR_SSL_WANT_READ : -1); @@ -14584,7 +14584,7 @@ int ssl_socket_send(void *ctx, const unsigned char *buf, size_t len) { struct mg_connection *nc = (struct mg_connection *) ctx; struct mg_lwip_conn_state *cs = (struct mg_lwip_conn_state *) nc->sock; int ret = mg_lwip_tcp_write(cs->nc, buf, len); - DBG(("%p mg_lwip_tcp_write %u = %d", cs->nc, len, ret)); + LOG(LL_DEBUG, ("%p %d -> %d", nc, len, ret)); if (ret == 0) ret = MBEDTLS_ERR_SSL_WANT_WRITE; return ret; } @@ -14610,6 +14610,7 @@ int ssl_socket_recv(void *ctx, unsigned char *buf, size_t len) { pbuf_free(seg); cs->rx_offset = 0; } + LOG(LL_DEBUG, ("%p <- %d", nc, (int) len)); return len; }