CCF
Loading...
Searching...
No Matches
Classes | Namespaces | Macros | Typedefs
curl.h File Reference
#include "ccf/ds/logger.h"
#include "ccf/ds/nonstd.h"
#include "ccf/rest_verb.h"
#include "host/proxy.h"
#include <cstddef>
#include <cstdint>
#include <curl/curl.h>
#include <curl/multi.h>
#include <memory>
#include <mutex>
#include <optional>
#include <regex>
#include <span>
#include <stdexcept>
#include <uv.h>

Go to the source code of this file.

Classes

class  ccf::curl::UniqueCURL
 
class  ccf::curl::UniqueCURLM
 
class  ccf::curl::UniqueSlist
 
class  ccf::curl::RequestBody
 
class  ccf::curl::ResponseBody
 
class  ccf::curl::ResponseHeaders
 
class  ccf::curl::CurlRequest
 
class  ccf::curl::CurlRequestCURLM
 
class  ccf::curl::CurlmLibuvContextImpl
 
class  ccf::curl::CurlmLibuvContextSingleton
 

Namespaces

namespace  ccf
 
namespace  ccf::curl
 

Macros

#define CHECK_CURL_EASY(fn, ...)
 
#define CHECK_CURL_EASY_SETOPT(handle, info, arg)    CHECK_CURL_EASY(curl_easy_setopt, handle, info, arg)
 
#define CHECK_CURL_EASY_GETINFO(handle, info, arg)    CHECK_CURL_EASY(curl_easy_getinfo, handle, info, arg)
 
#define CHECK_CURL_MULTI(fn, ...)
 

Typedefs

using ccf::curl::CurlmLibuvContext = asynchost::proxy_ptr< CurlmLibuvContextImpl >
 

Macro Definition Documentation

◆ CHECK_CURL_EASY

#define CHECK_CURL_EASY (   fn,
  ... 
)
Value:
do \
{ \
const auto res = fn(__VA_ARGS__); \
if (res != CURLE_OK) \
{ \
throw std::runtime_error(fmt::format( \
"Error calling " #fn ": {} ({})", res, curl_easy_strerror(res))); \
} \
} while (0)

◆ CHECK_CURL_EASY_GETINFO

#define CHECK_CURL_EASY_GETINFO (   handle,
  info,
  arg 
)     CHECK_CURL_EASY(curl_easy_getinfo, handle, info, arg)

◆ CHECK_CURL_EASY_SETOPT

#define CHECK_CURL_EASY_SETOPT (   handle,
  info,
  arg 
)     CHECK_CURL_EASY(curl_easy_setopt, handle, info, arg)

◆ CHECK_CURL_MULTI

#define CHECK_CURL_MULTI (   fn,
  ... 
)
Value:
do \
{ \
const auto res = fn(__VA_ARGS__); \
if (res != CURLM_OK) \
{ \
throw std::runtime_error(fmt::format( \
"Error calling " #fn ": {} ({})", res, curl_multi_strerror(res))); \
} \
} while (0)