From f27b465a97f595d82dcd1d556b2d550e57e82ac4 Mon Sep 17 00:00:00 2001 From: pyun Date: Tue, 7 Feb 2023 14:55:14 +0900 Subject: [PATCH] Fix the download fail issue on the normal environment Change-Id: Ib6ddcbe831dad72e5188f44a598cb3bd5d847bd8 Signed-off-by: Dohyun Pyun --- agent/download-agent-plugin-libcurl.c | 12 +++++++----- packaging/download-provider.spec | 2 +- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/agent/download-agent-plugin-libcurl.c b/agent/download-agent-plugin-libcurl.c index b1a5398..5a58df1 100755 --- a/agent/download-agent-plugin-libcurl.c +++ b/agent/download-agent-plugin-libcurl.c @@ -179,12 +179,14 @@ void __store_header(void *msg, da_info_t *da_info, size_t header_size, CURL *curl; http_raw_data_t *raw_data = DA_NULL; curl = http_info->http_msg->curl; - if (http_info->proxy_info) { - DA_LOGI("Proxy is set."); - res = curl_easy_getinfo(curl, CURLINFO_HTTP_CONNECTCODE, &status); - } else { + res = curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &status); - } + + if (res != CURLE_OK && http_info->proxy_info) { + DA_LOGI("Proxy is set."); + res = curl_easy_getinfo(curl, CURLINFO_HTTP_CONNECTCODE, &status); + } + if (res != CURLE_OK) { DA_LOGE("Fail to get response status code"); return; diff --git a/packaging/download-provider.spec b/packaging/download-provider.spec index 8503c2c..4a76322 100755 --- a/packaging/download-provider.spec +++ b/packaging/download-provider.spec @@ -1,6 +1,6 @@ Name: download-provider Summary: Download the contents in background -Version: 2.3.4 +Version: 2.3.5 Release: 0 Group: Development/Libraries License: Apache-2.0 -- 2.7.4