esp_http_client_read: Add check for esp_http_client_is_complete_data_received before returning ESP_FAIL

Closes: https://github.com/espressif/esp-idf/issues/6772
This commit is contained in:
Shubham Kulkarni 2021-03-30 12:46:24 +05:30 committed by bot
parent c8d15588e5
commit 7ad3837244

View File

@ -898,7 +898,7 @@ int esp_http_client_read(esp_http_client_handle_t client, char *buffer, int len)
}
ESP_LOG_LEVEL(sev, TAG, "esp_transport_read returned:%d and errno:%d ", rlen, errno);
}
if (rlen < 0 && ridx == 0) {
if (rlen < 0 && ridx == 0 && !esp_http_client_is_complete_data_received(client)) {
return ESP_FAIL;
} else {
return ridx;