Check both CURLINFO_RESPONSE_CODE and CURLINFO_HTTP_CONNECTCODE for HTTP status code 55/288355/1 accepted/tizen_6.5_unified tizen_6.5 accepted/tizen/6.5/unified/20230222.114611 submit/tizen_6.5/20230220.093942 submit/tizen_6.5/20230222.013215
authorAnjali Nijhara <a.nijhara@samsung.com>
Wed, 15 Feb 2023 10:20:56 +0000 (15:50 +0530)
committerAnjali Nijhara <a.nijhara@samsung.com>
Wed, 15 Feb 2023 11:01:29 +0000 (16:31 +0530)
Change-Id: I2e78b92dd4223dcaec60408b67922fc72d52d3ee

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

index a0444c0..622c06d 100755 (executable)
@@ -180,18 +180,19 @@ 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) {
+               res = curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &status);
+               if (status == 0 && 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);
                }
 
+               DA_LOGI("status code[%d]", (int)status);
+
                if (res != CURLE_OK) {
                        DA_LOGE("Fail to get response status code");
                        return;
                }
-               DA_LOGI("status code[%d]", (int)status);
+
                if (http_info->http_msg_response)
                        http_info->http_msg_response->status_code = (int)status;
                raw_data = (http_raw_data_t *)calloc(1, sizeof(http_raw_data_t));
index ca9496f..56bc876 100755 (executable)
@@ -1,6 +1,6 @@
 Name:       download-provider
 Summary:    Download the contents in background
-Version:    2.2.14
+Version:    2.2.15
 Release:    0
 Group:      Development/Libraries
 License:    Apache-2.0