From 582bf1878983b45e96d690a253d665a590b06266 Mon Sep 17 00:00:00 2001 From: Jitin George Date: Mon, 24 Dec 2018 10:56:08 +0530 Subject: [PATCH] tcp_transport: Fix incorrect error logging in ssl_read and ssl_write APIs Closes https://github.com/espressif/esp-idf/issues/2805 --- components/tcp_transport/transport_ssl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/tcp_transport/transport_ssl.c b/components/tcp_transport/transport_ssl.c index f2d346720..436f8a943 100644 --- a/components/tcp_transport/transport_ssl.c +++ b/components/tcp_transport/transport_ssl.c @@ -110,7 +110,7 @@ static int ssl_write(esp_transport_handle_t t, const char *buffer, int len, int return poll; } ret = esp_tls_conn_write(ssl->tls, (const unsigned char *) buffer, len); - if (ret <= 0) { + if (ret < 0) { ESP_LOGE(TAG, "esp_tls_conn_write error, errno=%s", strerror(errno)); } return ret; @@ -127,7 +127,7 @@ static int ssl_read(esp_transport_handle_t t, char *buffer, int len, int timeout } } ret = esp_tls_conn_read(ssl->tls, (unsigned char *)buffer, len); - if (ret <= 0) { + if (ret < 0) { ESP_LOGE(TAG, "esp_tls_conn_read error, errno=%s", strerror(errno)); } return ret;