mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
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:
parent
0d79e41ebc
commit
e957b50e50
@ -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)
|
ssize_t esp_tls_conn_read(esp_tls_t *tls, void *data, size_t datalen)
|
||||||
{
|
{
|
||||||
if (!tls || !data) {
|
if (!tls) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
return tls->read(tls, (char *)data, datalen);
|
return tls->read(tls, (char *)data, datalen);
|
||||||
|
Loading…
Reference in New Issue
Block a user