From 96d868d6026396f7be9f82f1d44f1163a2885aeb Mon Sep 17 00:00:00 2001 From: fzhenyu Date: Fri, 10 Dec 2021 10:37:18 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=BC=B1=E7=BD=91=E4=B8=8B?= =?UTF-8?q?=E4=B8=8B=E8=BD=BD=E8=BF=87=E7=A8=8B=E5=87=BA=E7=8E=B0=E9=93=BE?= =?UTF-8?q?=E8=B7=AF=E5=B1=82=E5=BC=82=E5=B8=B8=EF=BC=88=E5=B0=A4=E5=85=B6?= =?UTF-8?q?=E5=9C=A8=E5=BC=B1=E7=BD=91=E7=8E=AF=E5=A2=83=E4=B8=8B=E5=AE=B9?= =?UTF-8?q?=E6=98=93=E5=87=BA=E7=8E=B0=EF=BC=89=E7=9A=84=E4=B8=8B=E8=BD=BD?= =?UTF-8?q?=E5=A4=B1=E8=B4=A5=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: fzhenyu --- components/ota/aiot_ota_api.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/components/ota/aiot_ota_api.c b/components/ota/aiot_ota_api.c index a9363bb..85f4083 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); -- Gitee