fix(tcp_transport): Silence recoverable read failures

In some applications, ESP_TLS_ERR_SSL_WANT_READ and
ESP_TLS_ERR_SSL_TIMEOUT are common results which
need handled at the next layer. Downgrade these
to debug.
This commit is contained in:
Richard Allen
2025-05-16 08:14:36 -05:00
parent 6e5a178b31
commit 7f982fa09d

View File

@ -269,9 +269,12 @@ static int ssl_read(esp_transport_handle_t t, char *buffer, int len, int timeout
int ret = esp_tls_conn_read(ssl->tls, (unsigned char *)buffer, len);
if (ret < 0) {
ESP_LOGE(TAG, "esp_tls_conn_read error, errno=%s", strerror(errno));
if (ret == ESP_TLS_ERR_SSL_WANT_READ || ret == ESP_TLS_ERR_SSL_TIMEOUT) {
ret = ERR_TCP_TRANSPORT_CONNECTION_TIMEOUT;
ESP_LOGD(TAG, "esp_tls_conn_read error, errno=%s", strerror(errno));
}
else {
ESP_LOGE(TAG, "esp_tls_conn_read error, errno=%s", strerror(errno));
}
esp_tls_error_handle_t esp_tls_error_handle;