tcp_transport: Fix incorrect error logging in ssl_read and ssl_write APIs

Closes https://github.com/espressif/esp-idf/issues/2805
This commit is contained in:
Jitin George 2018-12-24 10:56:08 +05:30
parent 2e3f06ece8
commit 582bf18789

View 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;