Skip to content

Commit 7f982fa

Browse files
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.
1 parent 6e5a178 commit 7f982fa

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

components/tcp_transport/transport_ssl.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,9 +269,12 @@ static int ssl_read(esp_transport_handle_t t, char *buffer, int len, int timeout
269269

270270
int ret = esp_tls_conn_read(ssl->tls, (unsigned char *)buffer, len);
271271
if (ret < 0) {
272-
ESP_LOGE(TAG, "esp_tls_conn_read error, errno=%s", strerror(errno));
273272
if (ret == ESP_TLS_ERR_SSL_WANT_READ || ret == ESP_TLS_ERR_SSL_TIMEOUT) {
274273
ret = ERR_TCP_TRANSPORT_CONNECTION_TIMEOUT;
274+
ESP_LOGD(TAG, "esp_tls_conn_read error, errno=%s", strerror(errno));
275+
}
276+
else {
277+
ESP_LOGE(TAG, "esp_tls_conn_read error, errno=%s", strerror(errno));
275278
}
276279

277280
esp_tls_error_handle_t esp_tls_error_handle;

0 commit comments

Comments
 (0)