}
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);
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;