mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-12 13:27:36 +00:00
fix(esp_http_client): Fix OTA failure with partial download enabled
This commit fixes an issue encountered during OTA when partial download is enabled using an AWS signed URL restricted to GET requests. It also adds an API to retrieve the OTA image size from the Content-Range header.
This commit is contained in:
@@ -232,6 +232,7 @@ typedef struct {
|
||||
typedef enum {
|
||||
/* 2xx - Success */
|
||||
HttpStatus_Ok = 200,
|
||||
HttpStatus_PartialContent = 206,
|
||||
|
||||
/* 3xx - Redirection */
|
||||
HttpStatus_MultipleChoices = 300,
|
||||
@@ -642,6 +643,19 @@ int esp_http_client_get_status_code(esp_http_client_handle_t client);
|
||||
*/
|
||||
int64_t esp_http_client_get_content_length(esp_http_client_handle_t client);
|
||||
|
||||
/**
|
||||
* @brief Get http response content range (from header Content-Range)
|
||||
* The returned value is valid only if this function is invoked after
|
||||
* a successful call to `esp_http_client_perform`.
|
||||
* Content-Range is set to -1 if parsing fails or if the Content-Range header is not present.
|
||||
*
|
||||
* @param[in] client The esp_http_client handle
|
||||
*
|
||||
* @return
|
||||
* - Content-Range value as bytes
|
||||
*/
|
||||
int64_t esp_http_client_get_content_range(esp_http_client_handle_t client);
|
||||
|
||||
/**
|
||||
* @brief Close http connection, still kept all http request resources
|
||||
*
|
||||
|
Reference in New Issue
Block a user