fix(esp-tls): Reduce parameter check for esp_tls_conn_read

Previously the *data parameters of esp_tls_conn_read
    was required to be non-NULL after espressif/esp-idf!28358.
    This prevents users from using a functionality in esp_tls_conn_read
    where calling `esp_tls_conn_read(ctx, NULL, 0);` triggers the
    transfer of contents from tcp layer to mbedtls (ssl) layer.
    After this the user can read the contents from
    esp_tls_get_bytes_avail().
    This commit removes the additional NULL check on the data field
    to keep this functionality enabled.
This commit is contained in:
Aditya Patwardhan
2024-08-23 12:08:42 +05:30
committed by Mahavir Jain
parent d63eb1239c
commit 76d5665136

View File

@@ -132,7 +132,7 @@ static ssize_t tcp_write(esp_tls_t *tls, const char *data, size_t datalen)
ssize_t esp_tls_conn_read(esp_tls_t *tls, void *data, size_t datalen)
{
if (!tls || !data) {
if (!tls) {
return -1;
}
return tls->read(tls, (char *)data, datalen);