bug fix: handle empty proxy address 04/287904/2
authorSeonah Moon <seonah1.moon@samsung.com>
Tue, 7 Feb 2023 11:34:00 +0000 (20:34 +0900)
committerpyun <dh79.pyun@samsung.com>
Tue, 7 Feb 2023 11:50:51 +0000 (20:50 +0900)
1. Revert e09e63a4a974ec9e6f2c094d7562bc89cb3452f8
2. Exception handling for empty proxy address

Change-Id: I012edb83c505cc8c17d6078dfdaa75c291164112

agent/download-agent-plugin-conf.c
agent/download-agent-plugin-libcurl.c
packaging/download-provider.spec

index 4d3c5c5..b6417a7 100755 (executable)
@@ -75,6 +75,11 @@ char *get_proxy_address(void)
        }
 
        if (proxyRet) {
+               if (strlen(proxyRet) == 0) {
+                       DA_LOGE("Proxy is empty.");
+                       free(proxyRet);
+                       return NULL;
+               }
                DA_SECURE_LOGD("===== Proxy address[%s] =====", proxyRet);
                proxy = strdup(proxyRet);
                free(proxyRet);
index 5a58df1..b1a5398 100755 (executable)
@@ -179,14 +179,12 @@ 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;
index 4a76322..ecbd9a4 100755 (executable)
@@ -1,6 +1,6 @@
 Name:       download-provider
 Summary:    Download the contents in background
-Version:    2.3.5
+Version:    2.3.6
 Release:    0
 Group:      Development/Libraries
 License:    Apache-2.0