Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion ci/do_ci.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ if (!(test-path plugin)) {
}
$PLUGIN_DIR = Join-Path "$SRC_DIR" "plugin"

$VCPKG_DIR = Join-Path "$SRC_DIR" "tools" "vcpkg"
$VCPKG_DIR = Join-Path "$SRC_DIR" "tools/vcpkg"

$Env:CTEST_OUTPUT_ON_FAILURE = "1"

Expand Down Expand Up @@ -135,6 +135,9 @@ switch ($action) {
"cmake.maintainer.test" {
cd "$BUILD_DIR"
cmake $SRC_DIR `
-DWITH_OTLP_GRPC=ON `
-DWITH_OTLP_HTTP=ON `
-DWITH_OTLP_RETRY_PREVIEW=ON `
-DOTELCPP_MAINTAINER_MODE=ON `
-DWITH_NO_DEPRECATED_CODE=ON `
-DVCPKG_TARGET_TRIPLET=x64-windows `
Expand All @@ -159,6 +162,9 @@ switch ($action) {
cmake $SRC_DIR `
-DWITH_STL=CXX20 `
-DCMAKE_CXX_STANDARD=20 `
-DWITH_OTLP_GRPC=ON `
-DWITH_OTLP_HTTP=ON `
-DWITH_OTLP_RETRY_PREVIEW=ON `
-DOTELCPP_MAINTAINER_MODE=ON `
-DWITH_NO_DEPRECATED_CODE=ON `
-DVCPKG_TARGET_TRIPLET=x64-windows `
Expand Down Expand Up @@ -203,6 +209,9 @@ switch ($action) {
cd "$BUILD_DIR"
cmake $SRC_DIR `
-DVCPKG_TARGET_TRIPLET=x64-windows `
-DWITH_OTLP_GRPC=ON `
-DWITH_OTLP_HTTP=ON `
-DWITH_OTLP_RETRY_PREVIEW=ON `
-DWITH_OTPROTCOL=ON `
"-DCMAKE_TOOLCHAIN_FILE=$VCPKG_DIR/scripts/buildsystems/vcpkg.cmake"
$exit = $LASTEXITCODE
Expand Down
6 changes: 6 additions & 0 deletions ci/setup_windows_ci_environment.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,10 @@ $VCPKG_DIR = (Get-Item -Path ".\").FullName
# nlohmann-json
./vcpkg "--vcpkg-root=$VCPKG_DIR" install nlohmann-json:x64-windows

# grpc
./vcpkg "--vcpkg-root=$VCPKG_DIR" install grpc:x64-windows

# curl
./vcpkg "--vcpkg-root=$VCPKG_DIR" install curl:x64-windows

Pop-Location
18 changes: 9 additions & 9 deletions exporters/otlp/test/otlp_grpc_exporter_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -359,9 +359,9 @@ TEST_F(OtlpGrpcExporterTestPeer, ConfigRetryDefaultValues)
std::unique_ptr<OtlpGrpcExporter> exporter(new OtlpGrpcExporter());
const auto options = GetOptions(exporter);
ASSERT_EQ(options.retry_policy_max_attempts, 5);
ASSERT_FLOAT_EQ(options.retry_policy_initial_backoff.count(), 1.0);
ASSERT_FLOAT_EQ(options.retry_policy_max_backoff.count(), 5.0);
ASSERT_FLOAT_EQ(options.retry_policy_backoff_multiplier, 1.5);
ASSERT_FLOAT_EQ(options.retry_policy_initial_backoff.count(), 1.0f);
ASSERT_FLOAT_EQ(options.retry_policy_max_backoff.count(), 5.0f);
ASSERT_FLOAT_EQ(options.retry_policy_backoff_multiplier, 1.5f);
}

TEST_F(OtlpGrpcExporterTestPeer, ConfigRetryValuesFromEnv)
Expand All @@ -374,9 +374,9 @@ TEST_F(OtlpGrpcExporterTestPeer, ConfigRetryValuesFromEnv)
std::unique_ptr<OtlpGrpcExporter> exporter(new OtlpGrpcExporter());
const auto options = GetOptions(exporter);
ASSERT_EQ(options.retry_policy_max_attempts, 123);
ASSERT_FLOAT_EQ(options.retry_policy_initial_backoff.count(), 4.5);
ASSERT_FLOAT_EQ(options.retry_policy_max_backoff.count(), 6.7);
ASSERT_FLOAT_EQ(options.retry_policy_backoff_multiplier, 8.9);
ASSERT_FLOAT_EQ(options.retry_policy_initial_backoff.count(), 4.5f);
ASSERT_FLOAT_EQ(options.retry_policy_max_backoff.count(), 6.7f);
ASSERT_FLOAT_EQ(options.retry_policy_backoff_multiplier, 8.9f);

unsetenv("OTEL_CPP_EXPORTER_OTLP_TRACES_RETRY_MAX_ATTEMPTS");
unsetenv("OTEL_CPP_EXPORTER_OTLP_TRACES_RETRY_INITIAL_BACKOFF");
Expand All @@ -394,9 +394,9 @@ TEST_F(OtlpGrpcExporterTestPeer, ConfigRetryGenericValuesFromEnv)
std::unique_ptr<OtlpGrpcExporter> exporter(new OtlpGrpcExporter());
const auto options = GetOptions(exporter);
ASSERT_EQ(options.retry_policy_max_attempts, 321);
ASSERT_FLOAT_EQ(options.retry_policy_initial_backoff.count(), 5.4);
ASSERT_FLOAT_EQ(options.retry_policy_max_backoff.count(), 7.6);
ASSERT_FLOAT_EQ(options.retry_policy_backoff_multiplier, 9.8);
ASSERT_FLOAT_EQ(options.retry_policy_initial_backoff.count(), 5.4f);
ASSERT_FLOAT_EQ(options.retry_policy_max_backoff.count(), 7.6f);
ASSERT_FLOAT_EQ(options.retry_policy_backoff_multiplier, 9.8f);

unsetenv("OTEL_CPP_EXPORTER_OTLP_RETRY_MAX_ATTEMPTS");
unsetenv("OTEL_CPP_EXPORTER_OTLP_RETRY_INITIAL_BACKOFF");
Expand Down
18 changes: 9 additions & 9 deletions exporters/otlp/test/otlp_grpc_log_record_exporter_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -473,9 +473,9 @@ TEST_F(OtlpGrpcLogRecordExporterTestPeer, ConfigRetryDefaultValues)
std::unique_ptr<OtlpGrpcLogRecordExporter> exporter(new OtlpGrpcLogRecordExporter());
const auto options = GetOptions(exporter);
ASSERT_EQ(options.retry_policy_max_attempts, 5);
ASSERT_FLOAT_EQ(options.retry_policy_initial_backoff.count(), 1.0);
ASSERT_FLOAT_EQ(options.retry_policy_max_backoff.count(), 5.0);
ASSERT_FLOAT_EQ(options.retry_policy_backoff_multiplier, 1.5);
ASSERT_FLOAT_EQ(options.retry_policy_initial_backoff.count(), 1.0f);
ASSERT_FLOAT_EQ(options.retry_policy_max_backoff.count(), 5.0f);
ASSERT_FLOAT_EQ(options.retry_policy_backoff_multiplier, 1.5f);
}

TEST_F(OtlpGrpcLogRecordExporterTestPeer, ConfigRetryValuesFromEnv)
Expand All @@ -488,9 +488,9 @@ TEST_F(OtlpGrpcLogRecordExporterTestPeer, ConfigRetryValuesFromEnv)
std::unique_ptr<OtlpGrpcLogRecordExporter> exporter(new OtlpGrpcLogRecordExporter());
const auto options = GetOptions(exporter);
ASSERT_EQ(options.retry_policy_max_attempts, 123);
ASSERT_FLOAT_EQ(options.retry_policy_initial_backoff.count(), 4.5);
ASSERT_FLOAT_EQ(options.retry_policy_max_backoff.count(), 6.7);
ASSERT_FLOAT_EQ(options.retry_policy_backoff_multiplier, 8.9);
ASSERT_FLOAT_EQ(options.retry_policy_initial_backoff.count(), 4.5f);
ASSERT_FLOAT_EQ(options.retry_policy_max_backoff.count(), 6.7f);
ASSERT_FLOAT_EQ(options.retry_policy_backoff_multiplier, 8.9f);

unsetenv("OTEL_CPP_EXPORTER_OTLP_LOGS_RETRY_MAX_ATTEMPTS");
unsetenv("OTEL_CPP_EXPORTER_OTLP_LOGS_RETRY_INITIAL_BACKOFF");
Expand All @@ -508,9 +508,9 @@ TEST_F(OtlpGrpcLogRecordExporterTestPeer, ConfigRetryGenericValuesFromEnv)
std::unique_ptr<OtlpGrpcLogRecordExporter> exporter(new OtlpGrpcLogRecordExporter());
const auto options = GetOptions(exporter);
ASSERT_EQ(options.retry_policy_max_attempts, 321);
ASSERT_FLOAT_EQ(options.retry_policy_initial_backoff.count(), 5.4);
ASSERT_FLOAT_EQ(options.retry_policy_max_backoff.count(), 7.6);
ASSERT_FLOAT_EQ(options.retry_policy_backoff_multiplier, 9.8);
ASSERT_FLOAT_EQ(options.retry_policy_initial_backoff.count(), 5.4f);
ASSERT_FLOAT_EQ(options.retry_policy_max_backoff.count(), 7.6f);
ASSERT_FLOAT_EQ(options.retry_policy_backoff_multiplier, 9.8f);

unsetenv("OTEL_CPP_EXPORTER_OTLP_RETRY_MAX_ATTEMPTS");
unsetenv("OTEL_CPP_EXPORTER_OTLP_RETRY_INITIAL_BACKOFF");
Expand Down
18 changes: 9 additions & 9 deletions exporters/otlp/test/otlp_grpc_metric_exporter_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -225,9 +225,9 @@ TEST_F(OtlpGrpcMetricExporterTestPeer, ConfigRetryDefaultValues)
std::unique_ptr<OtlpGrpcMetricExporter> exporter(new OtlpGrpcMetricExporter());
const auto options = GetOptions(exporter);
ASSERT_EQ(options.retry_policy_max_attempts, 5);
ASSERT_FLOAT_EQ(options.retry_policy_initial_backoff.count(), 1.0);
ASSERT_FLOAT_EQ(options.retry_policy_max_backoff.count(), 5.0);
ASSERT_FLOAT_EQ(options.retry_policy_backoff_multiplier, 1.5);
ASSERT_FLOAT_EQ(options.retry_policy_initial_backoff.count(), 1.0f);
ASSERT_FLOAT_EQ(options.retry_policy_max_backoff.count(), 5.0f);
ASSERT_FLOAT_EQ(options.retry_policy_backoff_multiplier, 1.5f);
}

TEST_F(OtlpGrpcMetricExporterTestPeer, ConfigRetryValuesFromEnv)
Expand All @@ -240,9 +240,9 @@ TEST_F(OtlpGrpcMetricExporterTestPeer, ConfigRetryValuesFromEnv)
std::unique_ptr<OtlpGrpcMetricExporter> exporter(new OtlpGrpcMetricExporter());
const auto options = GetOptions(exporter);
ASSERT_EQ(options.retry_policy_max_attempts, 123);
ASSERT_FLOAT_EQ(options.retry_policy_initial_backoff.count(), 4.5);
ASSERT_FLOAT_EQ(options.retry_policy_max_backoff.count(), 6.7);
ASSERT_FLOAT_EQ(options.retry_policy_backoff_multiplier, 8.9);
ASSERT_FLOAT_EQ(options.retry_policy_initial_backoff.count(), 4.5f);
ASSERT_FLOAT_EQ(options.retry_policy_max_backoff.count(), 6.7f);
ASSERT_FLOAT_EQ(options.retry_policy_backoff_multiplier, 8.9f);

unsetenv("OTEL_CPP_EXPORTER_OTLP_METRICS_RETRY_MAX_ATTEMPTS");
unsetenv("OTEL_CPP_EXPORTER_OTLP_METRICS_RETRY_INITIAL_BACKOFF");
Expand All @@ -260,9 +260,9 @@ TEST_F(OtlpGrpcMetricExporterTestPeer, ConfigRetryGenericValuesFromEnv)
std::unique_ptr<OtlpGrpcMetricExporter> exporter(new OtlpGrpcMetricExporter());
const auto options = GetOptions(exporter);
ASSERT_EQ(options.retry_policy_max_attempts, 321);
ASSERT_FLOAT_EQ(options.retry_policy_initial_backoff.count(), 5.4);
ASSERT_FLOAT_EQ(options.retry_policy_max_backoff.count(), 7.6);
ASSERT_FLOAT_EQ(options.retry_policy_backoff_multiplier, 9.8);
ASSERT_FLOAT_EQ(options.retry_policy_initial_backoff.count(), 5.4f);
ASSERT_FLOAT_EQ(options.retry_policy_max_backoff.count(), 7.6f);
ASSERT_FLOAT_EQ(options.retry_policy_backoff_multiplier, 9.8f);

unsetenv("OTEL_CPP_EXPORTER_OTLP_RETRY_MAX_ATTEMPTS");
unsetenv("OTEL_CPP_EXPORTER_OTLP_RETRY_INITIAL_BACKOFF");
Expand Down
18 changes: 9 additions & 9 deletions exporters/otlp/test/otlp_http_exporter_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -640,9 +640,9 @@ TEST_F(OtlpHttpExporterTestPeer, ConfigRetryDefaultValues)
std::unique_ptr<OtlpHttpExporter> exporter(new OtlpHttpExporter());
const auto options = GetOptions(exporter);
ASSERT_EQ(options.retry_policy_max_attempts, 5);
ASSERT_FLOAT_EQ(options.retry_policy_initial_backoff.count(), 1.0);
ASSERT_FLOAT_EQ(options.retry_policy_max_backoff.count(), 5.0);
ASSERT_FLOAT_EQ(options.retry_policy_backoff_multiplier, 1.5);
ASSERT_FLOAT_EQ(options.retry_policy_initial_backoff.count(), 1.0f);
ASSERT_FLOAT_EQ(options.retry_policy_max_backoff.count(), 5.0f);
ASSERT_FLOAT_EQ(options.retry_policy_backoff_multiplier, 1.5f);
}

TEST_F(OtlpHttpExporterTestPeer, ConfigRetryValuesFromEnv)
Expand All @@ -655,9 +655,9 @@ TEST_F(OtlpHttpExporterTestPeer, ConfigRetryValuesFromEnv)
std::unique_ptr<OtlpHttpExporter> exporter(new OtlpHttpExporter());
const auto options = GetOptions(exporter);
ASSERT_EQ(options.retry_policy_max_attempts, 123);
ASSERT_FLOAT_EQ(options.retry_policy_initial_backoff.count(), 4.5);
ASSERT_FLOAT_EQ(options.retry_policy_max_backoff.count(), 6.7);
ASSERT_FLOAT_EQ(options.retry_policy_backoff_multiplier, 8.9);
ASSERT_FLOAT_EQ(options.retry_policy_initial_backoff.count(), 4.5f);
ASSERT_FLOAT_EQ(options.retry_policy_max_backoff.count(), 6.7f);
ASSERT_FLOAT_EQ(options.retry_policy_backoff_multiplier, 8.9f);

unsetenv("OTEL_CPP_EXPORTER_OTLP_TRACES_RETRY_MAX_ATTEMPTS");
unsetenv("OTEL_CPP_EXPORTER_OTLP_TRACES_RETRY_INITIAL_BACKOFF");
Expand All @@ -675,9 +675,9 @@ TEST_F(OtlpHttpExporterTestPeer, ConfigRetryGenericValuesFromEnv)
std::unique_ptr<OtlpHttpExporter> exporter(new OtlpHttpExporter());
const auto options = GetOptions(exporter);
ASSERT_EQ(options.retry_policy_max_attempts, 321);
ASSERT_FLOAT_EQ(options.retry_policy_initial_backoff.count(), 5.4);
ASSERT_FLOAT_EQ(options.retry_policy_max_backoff.count(), 7.6);
ASSERT_FLOAT_EQ(options.retry_policy_backoff_multiplier, 9.8);
ASSERT_FLOAT_EQ(options.retry_policy_initial_backoff.count(), 5.4f);
ASSERT_FLOAT_EQ(options.retry_policy_max_backoff.count(), 7.6f);
ASSERT_FLOAT_EQ(options.retry_policy_backoff_multiplier, 9.8f);

unsetenv("OTEL_CPP_EXPORTER_OTLP_RETRY_MAX_ATTEMPTS");
unsetenv("OTEL_CPP_EXPORTER_OTLP_RETRY_INITIAL_BACKOFF");
Expand Down
18 changes: 9 additions & 9 deletions exporters/otlp/test/otlp_http_log_record_exporter_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -762,9 +762,9 @@ TEST_F(OtlpHttpLogRecordExporterTestPeer, ConfigRetryDefaultValues)
std::unique_ptr<OtlpHttpLogRecordExporter> exporter(new OtlpHttpLogRecordExporter());
const auto options = GetOptions(exporter);
ASSERT_EQ(options.retry_policy_max_attempts, 5);
ASSERT_FLOAT_EQ(options.retry_policy_initial_backoff.count(), 1.0);
ASSERT_FLOAT_EQ(options.retry_policy_max_backoff.count(), 5.0);
ASSERT_FLOAT_EQ(options.retry_policy_backoff_multiplier, 1.5);
ASSERT_FLOAT_EQ(options.retry_policy_initial_backoff.count(), 1.0f);
ASSERT_FLOAT_EQ(options.retry_policy_max_backoff.count(), 5.0f);
ASSERT_FLOAT_EQ(options.retry_policy_backoff_multiplier, 1.5f);
}

TEST_F(OtlpHttpLogRecordExporterTestPeer, ConfigRetryValuesFromEnv)
Expand All @@ -777,9 +777,9 @@ TEST_F(OtlpHttpLogRecordExporterTestPeer, ConfigRetryValuesFromEnv)
std::unique_ptr<OtlpHttpLogRecordExporter> exporter(new OtlpHttpLogRecordExporter());
const auto options = GetOptions(exporter);
ASSERT_EQ(options.retry_policy_max_attempts, 123);
ASSERT_FLOAT_EQ(options.retry_policy_initial_backoff.count(), 4.5);
ASSERT_FLOAT_EQ(options.retry_policy_max_backoff.count(), 6.7);
ASSERT_FLOAT_EQ(options.retry_policy_backoff_multiplier, 8.9);
ASSERT_FLOAT_EQ(options.retry_policy_initial_backoff.count(), 4.5f);
ASSERT_FLOAT_EQ(options.retry_policy_max_backoff.count(), 6.7f);
ASSERT_FLOAT_EQ(options.retry_policy_backoff_multiplier, 8.9f);

unsetenv("OTEL_CPP_EXPORTER_OTLP_LOGS_RETRY_MAX_ATTEMPTS");
unsetenv("OTEL_CPP_EXPORTER_OTLP_LOGS_RETRY_INITIAL_BACKOFF");
Expand All @@ -797,9 +797,9 @@ TEST_F(OtlpHttpLogRecordExporterTestPeer, ConfigRetryGenericValuesFromEnv)
std::unique_ptr<OtlpHttpLogRecordExporter> exporter(new OtlpHttpLogRecordExporter());
const auto options = GetOptions(exporter);
ASSERT_EQ(options.retry_policy_max_attempts, 321);
ASSERT_FLOAT_EQ(options.retry_policy_initial_backoff.count(), 5.4);
ASSERT_FLOAT_EQ(options.retry_policy_max_backoff.count(), 7.6);
ASSERT_FLOAT_EQ(options.retry_policy_backoff_multiplier, 9.8);
ASSERT_FLOAT_EQ(options.retry_policy_initial_backoff.count(), 5.4f);
ASSERT_FLOAT_EQ(options.retry_policy_max_backoff.count(), 7.6f);
ASSERT_FLOAT_EQ(options.retry_policy_backoff_multiplier, 9.8f);

unsetenv("OTEL_CPP_EXPORTER_OTLP_RETRY_MAX_ATTEMPTS");
unsetenv("OTEL_CPP_EXPORTER_OTLP_RETRY_INITIAL_BACKOFF");
Expand Down
18 changes: 9 additions & 9 deletions exporters/otlp/test/otlp_http_metric_exporter_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1017,9 +1017,9 @@ TEST_F(OtlpHttpMetricExporterTestPeer, ConfigRetryDefaultValues)
std::unique_ptr<OtlpHttpMetricExporter> exporter(new OtlpHttpMetricExporter());
const auto options = GetOptions(exporter);
ASSERT_EQ(options.retry_policy_max_attempts, 5);
ASSERT_FLOAT_EQ(options.retry_policy_initial_backoff.count(), 1.0);
ASSERT_FLOAT_EQ(options.retry_policy_max_backoff.count(), 5.0);
ASSERT_FLOAT_EQ(options.retry_policy_backoff_multiplier, 1.5);
ASSERT_FLOAT_EQ(options.retry_policy_initial_backoff.count(), 1.0f);
ASSERT_FLOAT_EQ(options.retry_policy_max_backoff.count(), 5.0f);
ASSERT_FLOAT_EQ(options.retry_policy_backoff_multiplier, 1.5f);
}

TEST_F(OtlpHttpMetricExporterTestPeer, ConfigRetryValuesFromEnv)
Expand All @@ -1032,9 +1032,9 @@ TEST_F(OtlpHttpMetricExporterTestPeer, ConfigRetryValuesFromEnv)
std::unique_ptr<OtlpHttpMetricExporter> exporter(new OtlpHttpMetricExporter());
const auto options = GetOptions(exporter);
ASSERT_EQ(options.retry_policy_max_attempts, 123);
ASSERT_FLOAT_EQ(options.retry_policy_initial_backoff.count(), 4.5);
ASSERT_FLOAT_EQ(options.retry_policy_max_backoff.count(), 6.7);
ASSERT_FLOAT_EQ(options.retry_policy_backoff_multiplier, 8.9);
ASSERT_FLOAT_EQ(options.retry_policy_initial_backoff.count(), 4.5f);
ASSERT_FLOAT_EQ(options.retry_policy_max_backoff.count(), 6.7f);
ASSERT_FLOAT_EQ(options.retry_policy_backoff_multiplier, 8.9f);

unsetenv("OTEL_CPP_EXPORTER_OTLP_METRICS_RETRY_MAX_ATTEMPTS");
unsetenv("OTEL_CPP_EXPORTER_OTLP_METRICS_RETRY_INITIAL_BACKOFF");
Expand All @@ -1052,9 +1052,9 @@ TEST_F(OtlpHttpMetricExporterTestPeer, ConfigRetryGenericValuesFromEnv)
std::unique_ptr<OtlpHttpMetricExporter> exporter(new OtlpHttpMetricExporter());
const auto options = GetOptions(exporter);
ASSERT_EQ(options.retry_policy_max_attempts, 321);
ASSERT_FLOAT_EQ(options.retry_policy_initial_backoff.count(), 5.4);
ASSERT_FLOAT_EQ(options.retry_policy_max_backoff.count(), 7.6);
ASSERT_FLOAT_EQ(options.retry_policy_backoff_multiplier, 9.8);
ASSERT_FLOAT_EQ(options.retry_policy_initial_backoff.count(), 5.4f);
ASSERT_FLOAT_EQ(options.retry_policy_max_backoff.count(), 7.6f);
ASSERT_FLOAT_EQ(options.retry_policy_backoff_multiplier, 9.8f);

unsetenv("OTEL_CPP_EXPORTER_OTLP_RETRY_MAX_ATTEMPTS");
unsetenv("OTEL_CPP_EXPORTER_OTLP_RETRY_INITIAL_BACKOFF");
Expand Down
8 changes: 4 additions & 4 deletions ext/src/http/client/curl/http_client_curl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,7 @@ bool HttpClient::MaybeSpawnBackgroundThread()
#endif /* ENABLE_THREAD_INSTRUMENTATION_PREVIEW */

// curl_multi_poll is added from libcurl 7.66.0, before 7.68.0, we can only wait until
// timeout to do the rest jobs
// timeout to do the remaining jobs
#if LIBCURL_VERSION_NUM >= 0x074200
/* wait for activity, timeout or "nothing" */
mc = curl_multi_poll(self->multi_handle_, nullptr, 0,
Expand Down Expand Up @@ -646,16 +646,16 @@ void HttpClient::ScheduleAddSession(uint64_t session_id)
void HttpClient::ScheduleAbortSession(uint64_t session_id)
{
{
std::lock_guard<std::mutex> lock_guard{sessions_m_};
std::lock_guard<std::mutex> sessions_lock{sessions_m_};
auto session = sessions_.find(session_id);
if (session == sessions_.end())
{
std::lock_guard<std::recursive_mutex> lock_guard{session_ids_m_};
std::lock_guard<std::recursive_mutex> session_ids_lock{session_ids_m_};
pending_to_add_session_ids_.erase(session_id);
}
else
{
std::lock_guard<std::recursive_mutex> lock_guard{session_ids_m_};
std::lock_guard<std::recursive_mutex> session_ids_lock{session_ids_m_};
pending_to_abort_sessions_[session_id] = std::move(session->second);
pending_to_add_session_ids_.erase(session_id);

Expand Down
4 changes: 2 additions & 2 deletions ext/src/http/client/curl/http_operation_curl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@ std::chrono::system_clock::time_point HttpOperation::NextRetryTime()
{
static std::random_device rd;
static std::mt19937 gen(rd());
static std::uniform_real_distribution<float> dis(0.8, 1.2);
static std::uniform_real_distribution<float> dis(0.8f, 1.2f);

// The initial retry attempt will occur after initialBackoff * random(0.8, 1.2)
auto backoff = retry_policy_.initial_backoff;
Expand Down Expand Up @@ -1043,7 +1043,7 @@ CURLcode HttpOperation::Setup()
// TODO: control local port to use
// curl_easy_setopt(curl, CURLOPT_LOCALPORT, dcf_port);

rc = SetCurlLongOption(CURLOPT_TIMEOUT_MS, http_conn_timeout_.count());
rc = SetCurlLongOption(CURLOPT_TIMEOUT_MS, static_cast<long>(http_conn_timeout_.count()));
if (rc != CURLE_OK)
{
return rc;
Expand Down
Loading