Skip to content
Open
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
8 changes: 4 additions & 4 deletions include/curl-multi-asio/Multi.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ namespace cma
Complete(asio::error::operation_aborted);
}

void Complete(asio::error_code ec) noexcept
void Complete(cma::error_code ec) noexcept
{
if (Handled() == true)
return;
Expand Down Expand Up @@ -107,7 +107,7 @@ namespace cma
/// @brief Cancels any outstanding operations, and destroys handles.
/// If CMA_MANAGE_CURL is specified when the library is built and
/// this is the only instance of Multi, curl_global_cleanup will be called
~Multi() noexcept { asio::error_code ignored; Cancel(ignored); }
~Multi() noexcept { cma::error_code ignored; Cancel(ignored); }
// we don't allow copies, because multi handles can't be duplicated.
// there's not even a reason to do so, multi handles don't really hold
// much of a state themselves besides stuff that shouldn't be duplicated
Expand Down Expand Up @@ -174,7 +174,7 @@ namespace cma
/// @param ec The error code output
/// @param error The error to send to all open handlers
/// @return The number of asynchronous operations canceled
size_t Cancel(asio::error_code& ec,
size_t Cancel(cma::error_code& ec,
CURLMcode error = CURLMcode::CURLM_OK) noexcept;
/// @brief Cancels the outstanding asynchronous operation,
/// and calls the handler with asio::error::operation_aborted.
Expand Down Expand Up @@ -226,7 +226,7 @@ namespace cma
/// @param ec The error code
/// @param s The socket
/// @param what The type of event
void EventCallback(const asio::error_code& ec, curl_socket_t s,
void EventCallback(const cma::error_code& ec, curl_socket_t s,
int what, int* last) noexcept;
asio::any_io_executor m_executor;
#ifdef CMA_MANAGE_CURL
Expand Down
16 changes: 8 additions & 8 deletions src/Multi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Multi::Multi(const asio::any_io_executor& executor) noexcept
SetOption(CURLMoption::CURLMOPT_SOCKETDATA, this);
}

size_t Multi::Cancel(asio::error_code& ec, CURLMcode error) noexcept
size_t Multi::Cancel(cma::error_code& ec, CURLMcode error) noexcept
{
// if there are no operations, there is no need for a timer.
m_timer.cancel(ec);
Expand Down Expand Up @@ -49,7 +49,7 @@ bool Multi::Cancel(const Easy& easy, CURLMcode error) noexcept
// if there are no more operations, there is no need for a timer
if (m_easyHandlerMap.empty() == true)
{
asio::error_code ignored;
cma::error_code ignored;
m_timer.cancel(ignored);
}
return true;
Expand All @@ -58,7 +58,7 @@ bool Multi::Cancel(const Easy& easy, CURLMcode error) noexcept
int Multi::CloseSocketCb(Multi* userp, curl_socket_t item) noexcept
{
auto socketIt = userp->m_easySocketMap.find(item);
asio::error_code ec;
cma::error_code ec;
// move the socket out so it doesn't get stuck if the close fails.
// delete the old iterator
auto socket = std::move(socketIt->second);
Expand Down Expand Up @@ -124,20 +124,20 @@ int Multi::TimerCallback(CURLM* multi, long timeout_ms, Multi* userp) noexcept
if (timeout_ms == -1)
{
// delete the timer, per cURL docs
asio::error_code ignored;
cma::error_code ignored;
userp->m_timer.cancel(ignored);
}
else
{
// start the timer
userp->m_timer.expires_from_now(std::chrono::milliseconds(timeout_ms));
userp->m_timer.async_wait(asio::bind_executor(
userp->m_strand, [userp] (const asio::error_code& ec)
userp->m_strand, [userp] (const cma::error_code& ec)
{
if (ec)
return;
int still_running = 0;
asio::error_code ignored;
cma::error_code ignored;
if (auto err = curl_multi_socket_action(userp->GetNativeHandle(),
CURL_SOCKET_TIMEOUT, 0, &still_running); err != CURLMcode::CURLM_OK)
{
Expand Down Expand Up @@ -173,7 +173,7 @@ void Multi::CheckTransfers() noexcept
}
}

void Multi::EventCallback(const asio::error_code& ec, curl_socket_t s,
void Multi::EventCallback(const cma::error_code& ec, curl_socket_t s,
int what, int* last) noexcept
{
// make sure it's a socket that hasn't bene closed
Expand All @@ -183,7 +183,7 @@ void Multi::EventCallback(const asio::error_code& ec, curl_socket_t s,
if (what != *last && *last != CURL_POLL_INOUT)
return;
int still_running = 0;
asio::error_code ignored;
cma::error_code ignored;
if (ec)
what = CURL_CSELECT_ERR;
if (auto err = curl_multi_socket_action(GetNativeHandle(), s,
Expand Down