WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[DOWNLOAD] 开始下载: %s -> %s", url, save_path);
g_ln_is_file_downloading = 1;
- #ifdef SUPPORT_CAT1_SERVICE
uapi_pm_add_sleep_veto(PM_ID_DEBUG);
- #endif
HttpClient client = {0};
HttpClientData client_data = {0};
{
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[DOWNLOAD] fopen failed for %s", save_path);
g_ln_is_file_downloading = 0;
- #ifdef SUPPORT_CAT1_SERVICE
uapi_pm_remove_sleep_veto(PM_ID_DEBUG);
- #endif
return ERRCODE_FAIL;
}
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[DOWNLOAD] prepare failed: %d", prep);
fclose(fd);
g_ln_is_file_downloading = 0;
- #ifdef SUPPORT_CAT1_SERVICE
uapi_pm_remove_sleep_veto(PM_ID_DEBUG);
- #endif
return ERRCODE_FAIL;
}
fclose(fd);
HttpClientUnprepare(&client_data);
g_ln_is_file_downloading = 0;
- #ifdef SUPPORT_CAT1_SERVICE
uapi_pm_remove_sleep_veto(PM_ID_DEBUG);
- #endif
return ERRCODE_FAIL;
}
HttpClientClse(&client);
HttpClientUnprepare(&client_data);
g_ln_is_file_downloading = 0;
- #ifdef SUPPORT_CAT1_SERVICE
uapi_pm_remove_sleep_veto(PM_ID_DEBUG);
- #endif
return ERRCODE_FAIL;
}
fclose(fd);
HttpClientClse(&client);
HttpClientUnprepare(&client_data);
- #ifdef SUPPORT_CAT1_SERVICE
uapi_pm_remove_sleep_veto(PM_ID_DEBUG);
- #endif
return ERRCODE_FAIL;
}
total_written += written;
{
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "删除不完整文件成功\r\n");
}
- #ifdef SUPPORT_CAT1_SERVICE
uapi_pm_remove_sleep_veto(PM_ID_DEBUG);
- #endif
}
HttpClientUnprepare(&client_data);
fclose(fd);
g_ln_is_file_downloading = 0;
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "[DOWNLOAD] 下载过程结束,ret=%d", ret);
- #ifdef SUPPORT_CAT1_SERVICE
uapi_pm_remove_sleep_veto(PM_ID_DEBUG);
- #endif
return ret;
}