From abcb25db428dd4b7ff2fb3bf945d294863ffbc59 Mon Sep 17 00:00:00 2001 From: YangWeimin Date: Thu, 29 May 2025 10:22:47 +0800 Subject: [PATCH] long to int problem Signed-off-by: YangWeimin --- frameworks/js/napi/http/http_exec/src/http_exec.cpp | 1 - frameworks/native/http/http_client/http_client_task.cpp | 1 - utils/netstack_chr_client/include/i_netstack_chr_client.h | 4 ++-- utils/netstack_chr_client/src/netstack_chr_client.cpp | 4 ++-- 4 files changed, 4 insertions(+), 6 deletions(-) diff --git a/frameworks/js/napi/http/http_exec/src/http_exec.cpp b/frameworks/js/napi/http/http_exec/src/http_exec.cpp index f0e966937..8d4215801 100755 --- a/frameworks/js/napi/http/http_exec/src/http_exec.cpp +++ b/frameworks/js/napi/http/http_exec/src/http_exec.cpp @@ -56,7 +56,6 @@ #include "event_list.h" #if HAS_NETMANAGER_BASE #include "hitrace_meter.h" -#include "netstack_chr_client.h" #include "netstack_hisysevent.h" #endif #include "http_async_work.h" diff --git a/frameworks/native/http/http_client/http_client_task.cpp b/frameworks/native/http/http_client/http_client_task.cpp index 03d124f61..e00f4f685 100644 --- a/frameworks/native/http/http_client/http_client_task.cpp +++ b/frameworks/native/http/http_client/http_client_task.cpp @@ -31,7 +31,6 @@ #include "timing.h" #if HAS_NETMANAGER_BASE #include "http_client_network_message.h" -#include "netstack_chr_client.h" #endif #include "netstack_hisysevent.h" diff --git a/utils/netstack_chr_client/include/i_netstack_chr_client.h b/utils/netstack_chr_client/include/i_netstack_chr_client.h index 4abd2e836..45fc986be 100644 --- a/utils/netstack_chr_client/include/i_netstack_chr_client.h +++ b/utils/netstack_chr_client/include/i_netstack_chr_client.h @@ -24,7 +24,7 @@ namespace OHOS::NetStack::ChrClient { typedef struct DataTransHttpInfo { int uid; - int responseCode; + long responseCode; curl_off_t totalTime; curl_off_t nameLookUpTime; curl_off_t connectTime; @@ -42,7 +42,7 @@ typedef struct DataTransHttpInfo { long sslVerifyResult; curl_off_t appconnectTime; curl_off_t retryAfter; - int proxyError; + long proxyError; curl_off_t queueTime; long curlCode; long requestStartTime; diff --git a/utils/netstack_chr_client/src/netstack_chr_client.cpp b/utils/netstack_chr_client/src/netstack_chr_client.cpp index 3bb924fca..d7ffeec9d 100644 --- a/utils/netstack_chr_client/src/netstack_chr_client.cpp +++ b/utils/netstack_chr_client/src/netstack_chr_client.cpp @@ -23,7 +23,7 @@ namespace OHOS::NetStack::ChrClient { -static constexpr const int HTTP_REQUEST_SUCCESS = 200; +static constexpr const long HTTP_REQUEST_SUCCESS = 200; static constexpr const int HTTP_FILE_TRANSFER_SIZE_THRESHOLD = 100000; static constexpr const int HTTP_FILE_TRANSFER_TIME_THRESHOLD = 500000; @@ -158,7 +158,7 @@ void NetStackChrClient::GetHttpInfoFromCurl(CURL *handle, DataTransHttpInfo &htt httpInfo.redirectCount = GetNumericAttributeFromCurl(handle, CURLINFO_REDIRECT_COUNT); httpInfo.osError = GetNumericAttributeFromCurl(handle, CURLINFO_OS_ERRNO); httpInfo.sslVerifyResult = GetNumericAttributeFromCurl(handle, CURLINFO_PROXY_SSL_VERIFYRESULT); - httpInfo.proxyError = GetNumericAttributeFromCurl(handle, CURLINFO_PROXY_ERROR); + httpInfo.proxyError = GetNumericAttributeFromCurl(handle, CURLINFO_PROXY_ERROR); httpInfo.effectiveMethod = GetStringAttributeFromCurl(handle, CURLINFO_EFFECTIVE_METHOD); httpInfo.contentType = GetStringAttributeFromCurl(handle, CURLINFO_CONTENT_TYPE); -- Gitee