bug fix: handle empty proxy address 53/288353/1
authorAnjali Nijhara <a.nijhara@samsung.com>
Wed, 15 Feb 2023 10:07:20 +0000 (15:37 +0530)
committerAnjali Nijhara <a.nijhara@samsung.com>
Wed, 15 Feb 2023 11:00:24 +0000 (16:30 +0530)
Change-Id: I31f075d461d0deb889571dd02ba866bdfe537deb

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

index 4d3c5c501c864f1d3dd0b4507b25020f0df770b2..b6417a7c80a34fbf4a38a1eaa9075771c1e128f4 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 5a58df1a06e0cc66c17e1b5de6bf88b866fd5902..1ff0609a6a256f626abac997a6e00a42b6a828ef 100755 (executable)
@@ -180,12 +180,12 @@ void __store_header(void *msg, da_info_t *da_info, size_t header_size,
                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");
index 667b4f7b229e62ee4e6f47f4f472f38bb22e4d9e..a85356e9247095d297ec007cd2b3c78156f75c4f 100755 (executable)
@@ -1,6 +1,6 @@
 Name:       download-provider
 Summary:    Download the contents in background
-Version:    2.2.12
+Version:    2.2.13
 Release:    0
 Group:      Development/Libraries
 License:    Apache-2.0