]> granicus.if.org Git - esp-idf/commitdiff
tcp_transport: Fix incorrect error logging in ssl_read and ssl_write APIs
authorJitin George <jitin@espressif.com>
Mon, 24 Dec 2018 05:26:08 +0000 (10:56 +0530)
committerJitin George <jitin@espressif.com>
Tue, 12 Feb 2019 06:02:44 +0000 (11:32 +0530)
Closes https://github.com/espressif/esp-idf/issues/2805

components/tcp_transport/transport_ssl.c

index f2d34672068a2e3c6cfa0f9205dc97e907cb8508..436f8a943623033a26b6fe49db3798a7bf015581 100644 (file)
@@ -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;