diff --git a/components/ota/aiot_ota_api.c b/components/ota/aiot_ota_api.c index a9363bb5cceb3bd3908bbaa2813bcb6e071fdd43..85f4083488ccbd3b10ff50435df4a547bdfe9bed 100644 --- a/components/ota/aiot_ota_api.c +++ b/components/ota/aiot_ota_api.c @@ -830,6 +830,13 @@ int32_t aiot_download_send_request(void *handle) uint32_t renewal_start = range_start + download_handle->range_size_fetched; core_int2str(renewal_start, range_start_string, &range_start_string_len); + /* + * add by fzy 2021-12-10 + * 当下载过程中出现链路层异常时(弱网下出现),上层仍会循环下载 + * 这会导致本次range下range_size_fetched的持续累加,需要重新初始化range_size_fetched + */ + download_handle->range_size_fetched = 0; + /* 对于按照range下载的情况, 即range_end不为0的情况, 需要将其翻译成字符串 */ if (0 != range_end) { core_int2str(range_end, range_end_string, &range_end_string_len);