10#ifndef PROTO_FUZZER_CURL_RAII_H_
11#define PROTO_FUZZER_CURL_RAII_H_
17namespace proto_fuzzer {
24 if (easy !=
nullptr) {
25 curl_easy_cleanup(easy);
35 if (multi !=
nullptr) {
36 (void)curl_multi_cleanup(multi);
45 void operator()(curl_slist* list)
const noexcept { curl_slist_free_all(list); }
52 void operator()(curl_mime* mime)
const noexcept { curl_mime_free(mime); }
62using CurlMimePtr = std::unique_ptr<curl_mime, CurlMimeDeleter>;
std::unique_ptr< CURLM, CurlMultiDeleter > CurlMultiPtr
Unique ownership of a CURL multi handle.
std::unique_ptr< curl_slist, CurlSlistDeleter > CurlSlistPtr
Unique ownership of a caller-owned curl_slist.
std::unique_ptr< CURL, CurlEasyDeleter > CurlEasyPtr
Unique ownership of a CURL easy handle.
std::unique_ptr< curl_mime, CurlMimeDeleter > CurlMimePtr
Unique ownership of a caller-owned curl_mime tree.
Destroy an independently owned easy handle.
void operator()(CURL *easy) const noexcept
Release an easy handle through libcurl's matching cleanup API.
Destroy a caller-owned MIME tree, including transferred children.
void operator()(curl_mime *mime) const noexcept
Release a complete MIME tree through libcurl's matching cleanup API.
Destroy an independently owned multi handle.
void operator()(CURLM *multi) const noexcept
Release a multi handle through libcurl's matching cleanup API.
Destroy a caller-owned curl_slist.
void operator()(curl_slist *list) const noexcept
Release a complete caller-owned linked list.