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
3 changes: 1 addition & 2 deletions src/datadog/curl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@
#include <chrono>
#include <condition_variable>
#include <cstddef>
#include <iterator>
#include <list>
#include <memory>
#include <mutex>
#include <system_error>
#include <unordered_map>
#include <unordered_set>

#include "json.hpp"
#include "string_util.h"

namespace datadog {
Expand Down Expand Up @@ -428,7 +428,6 @@ void CurlImpl::drain(std::chrono::steady_clock::time_point deadline) {
});

log_on_error(curl_.multi_wakeup(multi_handle_));
clear_requests();
}

std::size_t CurlImpl::on_read_header(char *data, std::size_t,
Expand Down
2 changes: 0 additions & 2 deletions src/datadog/curl.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@
#include <string>
#include <thread>

#include "json.hpp"

namespace datadog {
namespace tracing {

Expand Down
25 changes: 0 additions & 25 deletions test/test_curl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -156,31 +156,6 @@ const auto ignore = [](auto &&...) {};

using namespace std::chrono_literals;

CURL_TEST("API") {
const auto clock = default_clock;
const auto logger = std::make_shared<MockLogger>();
SingleRequestMockCurlLibrary library;
const auto client = std::make_shared<Curl>(logger, clock, library);

SECTION("drain remove requests in-flight") {
/// Prevent to process the request.
library.on_multi_perform = [] { return CURLM_OK; };

const HTTPClient::URL url = {"http", "whatever", ""};

const auto result = client->post(url, ignore, "whatever", ignore, ignore,
clock().tick + 60min);

REQUIRE(result);
REQUIRE(library.created_handles_.size() == 1);
REQUIRE(library.destroyed_handles_.size() == 0);

client->drain(clock().tick + 1s);
CHECK(library.created_handles_.size() == 1);
CHECK(library.destroyed_handles_.size() == 1);
}
}

CURL_TEST("parse response headers and body") {
const auto clock = default_clock;
const auto logger = std::make_shared<MockLogger>();
Expand Down