Merge pull request !1669 from 马千里/master
This commit is contained in:
openharmony_ci 2024-11-12 04:24:00 +00:00 committed by Gitee
commit 3da871006b
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
3 changed files with 15 additions and 5 deletions

View File

@ -445,6 +445,8 @@ void HttpExec::CacheCurlPerformanceTiming(CURL *handle, RequestContext *context)
int64_t responseCode = 0;
(void)curl_easy_getinfo(handle, CURLINFO_RESPONSE_CODE, &responseCode);
long osErr = 0;
(void)curl_easy_getinfo(handle, CURLINFO_OS_ERRNO, &osErr);
/*
CURL_HTTP_VERSION_NONE 0
@ -460,13 +462,13 @@ void HttpExec::CacheCurlPerformanceTiming(CURL *handle, RequestContext *context)
", size:%{public}" CURL_FORMAT_CURL_OFF_T
", dns:%{public}.3f, connect:%{public}.3f, tls:%{public}.3f, firstSend:%{public}.3f"
", firstRecv:%{public}.3f, total:%{public}.3f, redirect:%{public}.3f"
", errCode:%{public}d, RespCode:%{public}s, httpVer:%{public}s, method:%{public}s",
", errCode:%{public}d, RespCode:%{public}s, httpVer:%{public}s, method:%{public}s, osErr:%{public}ld",
context->GetTaskId(), size, dnsTime, connectTime == 0 ? 0 : connectTime - dnsTime,
tlsTime == 0 ? 0 : tlsTime - connectTime,
firstSendTime == 0 ? 0 : firstSendTime - std::max({dnsTime, connectTime, tlsTime}),
firstRecvTime == 0 ? 0 : firstRecvTime - firstSendTime, totalTime, redirectTime,
context->IsExecOK() ? 0 : context->GetErrorCode(), std::to_string(responseCode).c_str(),
std::to_string(httpVer).c_str(), context->options.GetMethod().c_str());
std::to_string(httpVer).c_str(), context->options.GetMethod().c_str(), osErr);
#if HAS_NETMANAGER_BASE
if (EventReport::GetInstance().IsValid()) {
HttpPerfInfo httpPerfInfo;

View File

@ -672,6 +672,8 @@ void HttpClientTask::DumpHttpPerformance()
*/
int64_t httpVer = CURL_HTTP_VERSION_NONE;
(void)curl_easy_getinfo(curlHandle_, CURLINFO_HTTP_VERSION, &httpVer);
long osErr = 0;
(void)curl_easy_getinfo(curlHandle_, CURLINFO_OS_ERRNO, &osErr);
curl_off_t size = GetSizeFromCurl(curlHandle_);
NETSTACK_LOGI(
@ -687,13 +689,14 @@ void HttpClientTask::DumpHttpPerformance()
", errCode:%{public}d"
", RespCode:%{public}s"
", httpVer:%{public}s"
", method:%{public}s",
", method:%{public}s"
", osErr:%{public}ld",
taskId_, size, dnsTime, connectTime == 0 ? 0 : connectTime - dnsTime,
tlsTime == 0 ? 0 : tlsTime - connectTime,
firstSendTime == 0 ? 0 : firstSendTime - std::max({dnsTime, connectTime, tlsTime}),
firstRecvTime == 0 ? 0 : firstRecvTime - firstSendTime, totalTime, redirectTime,
error_.GetErrorCode(), std::to_string(responseCode).c_str(), std::to_string(httpVer).c_str(),
request_.GetMethod().c_str());
request_.GetMethod().c_str(), osErr);
if (EventReport::GetInstance().IsValid()) {
HttpPerfInfo httpPerfInfo;

View File

@ -66,9 +66,14 @@ void EpollMultiDriver::Step(int waitEventsTimeoutMs)
epoll_event events[MAX_EPOLL_EVENTS];
int eventsToHandle = poller_.Wait(events, MAX_EPOLL_EVENTS, waitEventsTimeoutMs);
if (eventsToHandle == -1) {
if (errno != EINTR) {
NETSTACK_LOGE("epoll wait error : %{public}d", errno);
}
return;
}
if (eventsToHandle == 0) {
NETSTACK_LOGE("epoll wait event 0 err: %{public}d", errno);
}
for (int idx = 0; idx < eventsToHandle; ++idx) {
if (incomingQueue_->GetSyncEvent().IsItYours(events[idx].data.fd)) {
IncomingRequestCallback();