Check both CURLINFO_RESPONSE_CODE and CURLINFO_HTTP_CONNECTCODE for HTTP status code 43/288343/2 accepted/tizen/7.0/unified/20230216.140333
authorAnjali Nijhara <a.nijhara@samsung.com>
Tue, 14 Feb 2023 08:07:55 +0000 (13:37 +0530)
committerAnjali Nijhara <a.nijhara@samsung.com>
Wed, 15 Feb 2023 09:28:13 +0000 (14:58 +0530)
Change-Id: Ic2330d88faf61e441e2384400ff9aede3f1fc538

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

index e3023dd..622c06d 100755 (executable)
@@ -179,17 +179,20 @@ 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) {
+
+               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 2e50fcf..ba4f7a4 100755 (executable)
@@ -1,6 +1,6 @@
 Name:       download-provider
 Summary:    Download the contents in background
-Version:    2.3.7
+Version:    2.3.8
 Release:    0
 Group:      Development/Libraries
 License:    Apache-2.0