esp_http_client: Add support to check the binary length of the recieved stream and compare it with the size mentioned in the header.

While downloading OTA firmware, if their is a Origin Respnse Timeout or the binary is only partially downloaded, OTA failure is observed. Checking binary size can also be helpful for simple http client applications.

Closes https://github.com/espressif/esp-idf/issues/3004
This commit is contained in:
Hrudaynath Dhabe
2019-08-02 19:18:44 +08:00
committed by Mahavir Jain
parent 90a6855d01
commit d4091f7cda
2 changed files with 32 additions and 1 deletions

View File

@@ -445,6 +445,17 @@ esp_err_t esp_http_client_set_redirection(esp_http_client_handle_t client);
*/
void esp_http_client_add_auth(esp_http_client_handle_t client);
/**
* @brief Checks if entire data in the response has been read without any error.
*
* @param[in] client The esp_http_client handle
*
* @return
* - true
* - false
*/
bool esp_http_client_is_complete_data_received(esp_http_client_handle_t client);
#ifdef __cplusplus
}
#endif