fix esp_https_ota_begin(): implements handling of HttpStatus_PartialContent-code 206

This commit is contained in:
Raoul Rubien
2025-12-03 13:17:14 +01:00
parent c6d093b1a1
commit 37cd2e2b48

View File

@@ -135,6 +135,13 @@ static esp_err_t _http_handle_response_code(esp_https_ota_t *https_ota_handle, i
} else if (status_code >= HttpStatus_InternalError) {
ESP_LOGE(TAG, "Server error (%d)", status_code);
return ESP_FAIL;
} else if (https_ota_handle->binary_file_len > 0
#if CONFIG_ESP_HTTPS_OTA_ENABLE_PARTIAL_DOWNLOAD
&& !https_ota_handle->partial_http_download
#endif
&& status_code != HttpStatus_PartialContent) {
ESP_LOGE(TAG, "Requested range header ignored by server");
return ESP_ERR_HTTP_RANGE_NOT_SATISFIABLE;
}
char upgrade_data_buf[256];