@@ -887,41 +887,37 @@ std::shared_ptr<HttpResponse> CurlHttpClient::MakeRequest(const std::shared_ptr<
887
887
}
888
888
889
889
#if LIBCURL_VERSION_NUM >= 0x073700 // 7.55.0
890
- curl_off_t AppConnectT;
891
- ret = curl_easy_getinfo (connectionHandle, CURLINFO_APPCONNECT_TIME_T, &AppConnectT); // Ssl Latency
892
- if (ret == CURLE_OK)
893
- {
894
- request->AddRequestMetric (GetHttpClientMetricNameByType (HttpClientMetricsType::SslLatency), AppConnectT * 1000 );
895
- }
890
+ curl_off_t metric;
891
+ ret = curl_easy_getinfo (connectionHandle, CURLINFO_APPCONNECT_TIME_T, &metric); // Ssl Latency
896
892
#else
897
- ret = curl_easy_getinfo (connectionHandle, CURLINFO_APPCONNECT_TIME, &timep); // Ssl Latency
893
+ double metric;
894
+ ret = curl_easy_getinfo (connectionHandle, CURLINFO_APPCONNECT_TIME, &metric); // Ssl Latency
895
+ #endif
898
896
if (ret == CURLE_OK)
899
897
{
900
- request->AddRequestMetric (GetHttpClientMetricNameByType (HttpClientMetricsType::SslLatency), static_cast <int64_t >(timep * 1000 ));
898
+ request->AddRequestMetric (GetHttpClientMetricNameByType (HttpClientMetricsType::SslLatency), static_cast <int64_t >(metric * 1000 ));
901
899
}
902
- #endif
903
900
904
- curl_off_t speed;
905
901
#if LIBCURL_VERSION_NUM >= 0x073700 // 7.55.0
906
- ret = curl_easy_getinfo (connectionHandle, CURLINFO_SPEED_DOWNLOAD_T, &speed ); // throughput
902
+ ret = curl_easy_getinfo (connectionHandle, CURLINFO_SPEED_DOWNLOAD_T, &metric ); // throughput
907
903
#else
908
- ret = curl_easy_getinfo (connectionHandle, CURLINFO_SPEED_DOWNLOAD, &speed ); // throughput
904
+ ret = curl_easy_getinfo (connectionHandle, CURLINFO_SPEED_DOWNLOAD, &metric ); // throughput
909
905
#endif
910
906
if (ret == CURLE_OK)
911
907
{
912
908
// Record two metric names to preserve backwards compat
913
- request->AddRequestMetric (GetHttpClientMetricNameByType (HttpClientMetricsType::Throughput), static_cast <int64_t >(speed ));
914
- request->AddRequestMetric (GetHttpClientMetricNameByType (HttpClientMetricsType::DownloadSpeed), static_cast <int64_t >(speed ));
909
+ request->AddRequestMetric (GetHttpClientMetricNameByType (HttpClientMetricsType::Throughput), static_cast <int64_t >(metric ));
910
+ request->AddRequestMetric (GetHttpClientMetricNameByType (HttpClientMetricsType::DownloadSpeed), static_cast <int64_t >(metric ));
915
911
}
916
912
917
913
#if LIBCURL_VERSION_NUM >= 0x073700 // 7.55.0
918
- ret = curl_easy_getinfo (connectionHandle, CURLINFO_SPEED_UPLOAD_T, &speed ); // Upload Speed
914
+ ret = curl_easy_getinfo (connectionHandle, CURLINFO_SPEED_UPLOAD_T, &metric ); // Upload Speed
919
915
#else
920
- ret = curl_easy_getinfo (connectionHandle, CURLINFO_SPEED_UPLOAD, &speed ); // Upload Speed
916
+ ret = curl_easy_getinfo (connectionHandle, CURLINFO_SPEED_UPLOAD, &metric ); // Upload Speed
921
917
#endif
922
918
if (ret == CURLE_OK)
923
919
{
924
- request->AddRequestMetric (GetHttpClientMetricNameByType (HttpClientMetricsType::UploadSpeed), static_cast <int64_t >(speed ));
920
+ request->AddRequestMetric (GetHttpClientMetricNameByType (HttpClientMetricsType::UploadSpeed), static_cast <int64_t >(metric ));
925
921
}
926
922
927
923
const char * ip = nullptr ;
0 commit comments