mirror of
https://github.com/cesanta/mongoose.git
synced 2024-12-29 16:25:54 +08:00
Raise log level of mbedTLS socket evs to LL_DEBUG
PUBLISHED_FROM=ed0ac4133342c733977e7884a6bbadab7ee74127
This commit is contained in:
parent
b8c3740446
commit
7988acbff4
@ -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) {
|
static int ssl_socket_send(void *ctx, const unsigned char *buf, size_t len) {
|
||||||
struct mg_connection *nc = (struct mg_connection *) ctx;
|
struct mg_connection *nc = (struct mg_connection *) ctx;
|
||||||
int n = (int) MG_SEND_FUNC(nc->sock, buf, len, 0);
|
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;
|
if (n >= 0) return n;
|
||||||
n = mg_get_errno();
|
n = mg_get_errno();
|
||||||
return ((n == EAGAIN || n == EINPROGRESS) ? MBEDTLS_ERR_SSL_WANT_WRITE : -1);
|
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) {
|
static int ssl_socket_recv(void *ctx, unsigned char *buf, size_t len) {
|
||||||
struct mg_connection *nc = (struct mg_connection *) ctx;
|
struct mg_connection *nc = (struct mg_connection *) ctx;
|
||||||
int n = (int) MG_RECV_FUNC(nc->sock, buf, len, 0);
|
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;
|
if (n >= 0) return n;
|
||||||
n = mg_get_errno();
|
n = mg_get_errno();
|
||||||
return ((n == EAGAIN || n == EINPROGRESS) ? MBEDTLS_ERR_SSL_WANT_READ : -1);
|
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_connection *nc = (struct mg_connection *) ctx;
|
||||||
struct mg_lwip_conn_state *cs = (struct mg_lwip_conn_state *) nc->sock;
|
struct mg_lwip_conn_state *cs = (struct mg_lwip_conn_state *) nc->sock;
|
||||||
int ret = mg_lwip_tcp_write(cs->nc, buf, len);
|
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;
|
if (ret == 0) ret = MBEDTLS_ERR_SSL_WANT_WRITE;
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@ -14610,6 +14610,7 @@ int ssl_socket_recv(void *ctx, unsigned char *buf, size_t len) {
|
|||||||
pbuf_free(seg);
|
pbuf_free(seg);
|
||||||
cs->rx_offset = 0;
|
cs->rx_offset = 0;
|
||||||
}
|
}
|
||||||
|
LOG(LL_DEBUG, ("%p <- %d", nc, (int) len));
|
||||||
return len;
|
return len;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user