Raise log level of mbedTLS socket evs to LL_DEBUG

PUBLISHED_FROM=ed0ac4133342c733977e7884a6bbadab7ee74127
This commit is contained in:
Deomid Ryabkov 2017-01-26 12:18:50 +00:00 committed by Cesanta Bot
parent b8c3740446
commit 7988acbff4

View File

@ -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;
}